Here are the relevant snippets from my XML configuration file:

  <appender name="LogFile" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="C:\\test\\logs\\webmedx.log"/>
    <param name="MaxFileSize" value="1024KB"/>
    <param name="MaxBackupIndex" value="5"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern"
        value="%8r %-5p [%30.30t] %-25.25c - %m\n"/>
    </layout>
  </appender>
  <appender name="Struts" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="C:\\test\\logs\\struts.log"/>
    <param name="MaxFileSize" value="1024KB"/>
    <param name="MaxBackupIndex" value="5"/>
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern"
        value="%8r %-5p [%t] %c - %m\n"/>
    </layout>
  </appender>
  <logger name="webmedx" additivity="false">
    <level value="INFO"/>
    <appender-ref ref="LogFile"/>
  </logger>
  <logger name="org.apache.struts" additivity="false">
    <level value="ERROR"/>
    <appender-ref ref="Struts"/>
  </logger>

All of our classes are located in the webmedx package, and logging messages with a level greater than INFO are sent to C:\test\logs\webmedx.log. Struts logging messages of ERROR or greater are sent to C:\test\logs\struts.log.

-- Jeff


Nicholas Hemley wrote:
Chris,

many thanks for the info, I was actually looking for an xml config
example, having looked through the examples with log4j it is not so
obvious...

Cheerio,
Nic.


[EMAIL PROTECTED] 26/11/2004 13:59:10 >>>

log4j.logger.com.myapp=DEBUG,A1 log4j.logger.org.apache.struts=FATAL,A2

where A1 and A2 are different console or file appenders.

-----Original Message-----
From: Nicholas Hemley [mailto:[EMAIL PROTECTED] Sent: 26 November 2004 12:29
To: [EMAIL PROTECTED] Subject: Applicaton-specific logging in Struts



Hello,

I have implemented a plugin to configure the logging for my
application
but my application debug log is getting swamped by the struts debug
logging.

As I understand it, struts uses the common logging based on log4j but
I
cannot find an example of how to separate struts logging from
application logging.

Essentially, what I would like to do is configure the logging so that
classes in my packages go to a different file!

Any help would be appreciated for this [not so major] problem...

Cheerio,
Nic.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to