Reputation: 1676
may anyone explain for my question as below.
Now, Im tracing log in catalina.out. My question:
During running of the application "this is log4j output" is shown, but "This is system out put" is not shown.
This is log4j configuration:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="console" />
</root>
</log4j:configuration>
I think that both of them will be shown (log4j output and system.out).
I dont know why. May anyone explain the question?
Thanks!
Upvotes: 0
Views: 545
Reputation: 140467
System.out
prints to the "standard out" console. That can be your text console, but it could be anything, as it can easily be configured to go elsewhere.
On the other hand, any logger library can be configured to log to any place you want to.
Long story short: most likely, this is due to some specific configuration setting in your environment. But we don't know your setup, so we can't give any more specific answer.
Upvotes: 3