I am using slf4j logging with logback and at the beginning of my app I wrote
InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
then I added to the pipeline a new LoggingHandler(InternalLogLevel.DEBUG)
instance.
Unfortunately, this still does not log anything, I was debugging into and the debug level is the problem, just skips the logging itself.
How should I setup to get working this LoggingHandler
?
I have done a small example, that does work - I placed it on gist on github. It uses logback as the backend of the slf4j. The moments that should be paid attention to are:
InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.INSTANCE);
should be executed right on the entry point of your program. Sometimes this "entry point" may be very hard to determine.Even without LoggingHandler you should see two debug messages from static initializer of org.jboss.netty.channel.socket.nio.SelectorUtil (with Netty version 3.6.0.Final):
11:54:00.959 [main] DEBUG o.j.n.c.socket.nio.SelectorUtil - Using select timeout of 500
11:54:00.962 [main] DEBUG o.j.n.c.socket.nio.SelectorUtil - Epoll-bug workaround enabled = false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With