I tried using 1.2.9 (stable) and I was able to get the RollingFileAppend to
work.  When I try running my application from a command line, I get this
error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Category

Here is my full config file:

# Set root category priority to DEBUG and set its only appender to Console
log4j.rootCategory=DEBUG, Console, R

# Console is set to be a ConsoleAppender (writes to system console).
log4j.appender.Console=org.apache.log4j.ConsoleAppender

# R is set to be a RollingFileAppender (writes to file).
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=bouncebacks.log
log4j.appender.R.MaxFileSize=100KB

# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

# R uses PatternLayout.
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

# Console uses PatternLayout.
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%5p]: (%C{1}.%M:%L) - %m%n

# dynamic log reader "Chainsaw"
#  connects to chainsaw reader which must be running separately
#  ex) java -classpath [path]/log4j.jar  org.apache.log4j.chainsaw.Main
log4j.appender.Chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.Chainsaw.remoteHost=localhost
log4j.appender.Chainsaw.port=4445
log4j.appender.Chainsaw.locationInfo=true

-----Original Message-----
From: Curt Arnold [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 15, 2005 4:26 PM
To: Log4J Users List
Subject: Re: RollingFileAppender


On Mar 15, 2005, at 2:58 PM, Jason Roscoe wrote:

>
> We are using log4j 1.3 Alpha 3, so what all will I need to do?
>

I was hoping the analysis would get you off and running by yourself.

You have to choose an option:

Upgrade the the CVS HEAD and remove the ".rolling" from the classname.
Configure the new, more generic, log4j 1.3 RFA.

Unfortunately, I could not find an appropriate sample for the latter in 
the test input files and wanted to avoid trying to mock up something 
freehand. I don't believe the new RFA can be configured using an 
properties file, since you have to configure nested objects, a 
TriggeringPolicy (to determine when to change files) and RollingPolicy 
(to determine what the file names are).


Something like:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration>

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j'>

   <appender name="R" 
class="org.apache.log4j.rolling.RollingFileAppender">
     <rollingPolicy 
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
       <param name="minIndex" value="1"/>
       <param name="maxIndex" value="1"/>
      <param name="activeFileName" value="bouncebacks.log"/>
      <param name="fileNamePattern" value="bouncebacks.log.%i"/>
     </rollingPolicy>

     <triggeringPolicy 
class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
         <param name="maxFileSize" value="100KB"/>
     </triggeringPolicy>

   </appender>
....

</log4j:configuration>


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





Disclaimer: This e-mail message is intended only for the personal use of 
the recipient(s) named above.  If you are not an intended recipient, you 
may not review, copy or distribute this message. If you have received this
communication in error, please notify us immediately by e-mail and delete 
the original message.
This e-mail expresses views only of the sender, which are not to be 
attributed to Rite Aid Corporation and may not be copied or distributed 
without this statement.

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

Reply via email to