logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Denno" <pde...@tsi.bc.ca>
Subject RE: log4j...help.
Date Thu, 02 Mar 2006 22:48:40 GMT
This has been discussed before so search the mail archive and you should
find plenty.

One solution would be if you have access to VM start then set a system
property using the -D mechanism.

Then in your config file reference the system property using
"${<property you set>}/perf.log".
(I think the syntax is correct, but check the archive).


-----Original Message-----
From: Billy W. Talton [mailto:Billy.W.Talton@supervalu.com] 
Sent: Thursday, March 02, 2006 2:19 PM
To: log4j-user@logging.apache.org
Subject: log4j...help.


I haven't used log4j a whole lot.  Having noticed that logging in not
particularly a strongsuit in the applications at my job, I decided that
I would implement this industry-standard in my next project.  I
downloaded the latest version, installed and configured it rather easily
and I was off and running.. i thought.  I've been stumped by this one
I've been going nuts trying to figure out how to output to a
file/directory in my web application.  I'm able to go to database and 
console just fine.  A few other Appenders worked as well.   As I've
 log4j prints directly to my WSAD root install directory.  This is a
problem for me since I share a server with other teams and applications.
I could create a NAS share but that creates portability issues.  This
has to be simple but I'm Googlestumped.  Here's my log file.  Any ideas?


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration
        <appender name="USER_LOG"
                <param name="Threshold" value="debug" />
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%-5p
- %m\n" />
        <appender name="PERF_LOG" class="org.apache.log4j.FileAppender">
                <param name="File" value="perf.log" />
                <param name="Threshold" value="info" />
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%-5p
- %m\n" />
        <appender name="ROLE_LOG" class=
                <param name="File" value="es_edi.log" />
                <param name="MaxBackupIndex" value="10" />
                <param name="MaxFileSize" value="1000KB" />
                <param name="Threshold" value="debug" />
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="[%d] %t
%c %-5p - %m%n" />

        <logger name="com.xxx.xxx">
                <level value="DEBUG" />
                <appender-ref ref="PERF_LOG" />
                <appender-ref ref="USER_LOG" />
                <appender-ref ref="ROLE_LOG" />

                <priority value="debug" />
                <appender-ref ref="USER_LOG" />

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message