I cannot log to the console using logback. Nothing is showing up when I run my application.
here my logback file content
<?xml version="1.0" encoding="UTF-8"?>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} -
%msg%n
</Pattern>
</layout>
</appender>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
</root>
for example I can't get the message "Starting debugging":
logger.debug("Starting debugging");
ConnectorTopology ConnectorTopology= new ConnectorTopology();
and my topology of storm is working 100%
You should never use multiple root-elements. Remove one of them and set the level of the remaining one to DEBUG.
Also the pattern-tag should be enclosed in an encoder-tag, not a layout-tag:
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
See the manual for more details: http://logback.qos.ch/manual/appenders.html#ConsoleAppender
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