Save This Page
Home » apache-log4j-1.2.15 » examples.lf5 » InitUsingMultipleAppenders » [javadoc | source]
examples.lf5.InitUsingMultipleAppenders
public class: InitUsingMultipleAppenders [javadoc | source]
java.lang.Object
   examples.lf5.InitUsingMultipleAppenders.InitUsingMultipleAppenders
This example shows how to use LogFactor5 with other Log4J appenders (In this case the RollingFileAppender). The following lines can be added to the log4j.properties file or a standard Java properties file. # Two appenders are registered with the root of the Category tree. log4j.rootCategory=, A1, R # A1 is set to be a LF5Appender which outputs to a swing # logging console. log4j.appender.A1=org.apache.log4j.lf5.LF5Appender # R is the RollingFileAppender that outputs to a rolling log # file called rolling_log_file.log. log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=rolling_log_file.log log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=Date - %d{DATE}%nPriority - %p%nThread - %t%nCategory - %c%nLocation - %l%nMessage - %m%n%n log4j.appender.R.MaxFileSize=100KB log4j.appender.R.MaxBackupIndex=1 To make this example work, either run the InitUsingMultipleAppenders.bat file located in the examples folder or run it at the command line. If you are running the example at the command line, you must ensure that the example.properties file is in your classpath.
Method from examples.lf5.InitUsingMultipleAppenders.InitUsingMultipleAppenders Summary:
main
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from examples.lf5.InitUsingMultipleAppenders.InitUsingMultipleAppenders Detail:
 public static  void main(String[] argv)