In server/default/conf/log4j.xml I have the following:

<appender name="system" class="org.apache.log4j.FileAppender">
<param name="Threshold" value="DEBUG"/>
<param name="Append" value="false"/>
<param name="File" value="/usr/local/jboss/server/default/log/debug.log"/>

<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>

In my class I'm getting a logger and logging a test message like so:

Logger _systemLogger = Logger.getLogger("system");
_systemLogger.debug("Hey, is this thing on?");

The strange thing is that the message does not appear in /usr/local/jboss/server/default/log/debug.log, and in fact no such file ever gets created. Instead I see:

2003-09-04 00:56:27,291 DEBUG [system] Hey, is this thing on?

in server/default/log/server.log. That file is mentioned in two of the appenders that are commented out. I don't know why my messages are going to that file instead of the one that I have told the appender to use.
Another thing that would be very nice would be the ability to send everything that met the "system" appender's threshold to both the logfile and the console. I don't want to have to change the "CONSOLE" appender's threshold to DEBUG because then I get a ton of messages from JBoss' internals and this really slows things down.
Attached is my entire log4j.xml.
Thanks in advance,
-M@


Attachment: log4j.xml
Description: Binary data

Reply via email to