[logback-user] logger wildcard name?

Joseph Schmoley jacomoman78 at gmail.com
Fri Apr 8 02:13:16 CEST 2011

I've got a logback.xml config (pasted below).  All I'm trying to do is have
a different logging level, as well as slightly different encoder pattern,
for what shows up in the console vs. what gets written to a file.

I understand that you have to create 2 different appenders, FILE and
CONSOLE, then set root logger for console only with leve="info", and create
a separate logger referencing FILE appender with a different logging level.

I've done this, but I can't figure out how to set the logger name to a
wildcard so I can get "ALL" output directed to the file.  You see, just like
the root logger that has no "name", I want that for the <logger> as well,
but it requires a name and I've tried putting "*" in it and it doesn't
work.  I don't want to log just "com.acme.*" output, I want to log
everything the root logger is logging.

Help please!

Thank you.

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread] [%class{0}:%line]
 <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<pattern>%d{HH:mm:ss.SSS} %level [%thread] [%class{0}:%line]
 <logger name="com.acme" level="debug" additivity="false">
<appender-ref ref="FILE" />

<root level="info">
<appender-ref ref="CONSOLE" />
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110407/21f06bbb/attachment-0001.html>

More information about the Logback-user mailing list