@Slf4j Default Log level

795 views
Skip to first unread message

MoHammed Kanchwala

unread,
Nov 24, 2020, 5:45:14 AM11/24/20
to Project Lombok
I am using lombok in my project and used @Slf4j for logging purpose. but the log level for log variable created is always null because of which log.debug doesn't work.

Can someone please help on this.?

Reinier Zwitserloot

unread,
Dec 29, 2020, 11:24:44 AM12/29/20
to Project Lombok
@Slf4j just generates: org.slf4j.LoggerFactory.getLogger(LogExample.class);

If that's not good, then file bugs or ask for  help with slf4j, because that is what their very tutorial suggests.

Perhaps if you showed the code you wrote and exactly how it doesn't work (post the compiler or runtime error you get, or if no errors occur, what behaviour you observe vs. what you wanted it to do), someone can help you out.

Jan Materne

unread,
Dec 29, 2020, 11:59:49 AM12/29/20
to project...@googlegroups.com
When you ard using a logging framework you distinguish between a loglevel per message and a threshold when the framework will process the message. 
That threshold could be configured per logger with a default.
But that's usually not in Java but in the configuration of the logging framework. 

So your app has to
1. get a logger
2. use that logger for writing a message with message-loglevel.
For #1 Lombok could help. 

Jan

--
You received this message because you are subscribed to the Google Groups "Project Lombok" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-lombo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/project-lombok/29e6606c-eb6d-4896-853b-a9a2d4775425n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages