Hello David,
From the code you provided, it was not possible to determine the class it was
in. Anyway, since the appenders (STDOUT and FILE) are attached to the root
logger, the logger retrieved by the LoggerFactory.getLogger(this.getClass())
call is most probably not the root logger. It follows that that logger will not
have any appenders attached to it.
Therefore, the "if (app1 !=null)" check will return false and the subsequent
logger call will not be made.
HTH,
David Brocard wrote:
Hi
I am new to Tomcat & logback
I'm using tomcat 5.5.25
I try to use a file appender
my conf is :
<configuration>
<appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss} %X{host} %-5level %logger - %msg%n</Pattern>
</layout>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<File>testFile.log</File>
<Append>true</Append>
<Encoding>UTF-8</Encoding>
<BufferedIO>false</BufferedIO>
<ImmediateFlush>true</ImmediateFlush>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
<logger name="milan">
<level value="INFO" />
</logger>
<root>
<level value="debug" />
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
the statusprinter confirm that the configuration has been taken into
account :
[snip]
I can retreive the name of my logger but I cannot retrieve the Appender
object
why ?
thanks
------------------------------------------------------------------------
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user
--
Ceki Gülcü
QOS.ch is looking to hire talented developers in Switzerland. If
interested, please contact c e k i @ q o s . c h
_______________________________________________
Logback-user mailing list
[email protected]
http://qos.ch/mailman/listinfo/logback-user