logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niraj Patel" <nirajbpa...@googlemail.com>
Subject Appenders writing log file when not called apon
Date Wed, 29 Aug 2007 09:30:27 GMT
I have a log4j.xml file which is used by dozens of classes throughout the
day. One of these classes needs to log some data into a separate file, so I
created the following config:

<appender name="XXX" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="../logs/XXX.log"/>
    <param name="Append" value="true"/>
    <param name="DatePattern" value="'.'yyyy-MM-dd" />
</appender>

<category name="a.b.c.XXXClass">
    <appender-ref ref="XXX" />
</category>

Although the XXX.log file is written to disk (albeit empty) every time the
log4j engine is initialised by the other classes.

Am I correct in saying that the Log4J engine will parse all appenders and
write any log files not on disk, to disk?

Is there a way to stop this? I only want the log file to be written onto
disk when XXXClass logs data.

Cheers in advance,

Niraj

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message