Re: Writing logs to several files
See the recent thread with a subject of "level based logging into seperate files" On 8/11/07, Chamal De Silva <[EMAIL PROTECTED]> wrote: > Hi, > > I am using RollingFileAppender. > This is my log4j properties file. > > log4j.rootLogger=debug, R > log4j.appender.R=org.apache.log4j.RollingFileAppender > log4j.appender.R.File=syslog.log > log4j.appender.R.MaxFileSize=100KB > log4j.appender.R.MaxBackupIndex=5 > log4j.appender.R.layout=org.apache.log4j.PatternLayout > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n > > But I want to write debug messages to a file called sysdebug.log, info > messages to sysinfo.log and errors to syserror.log. Please tell me how to > do this. > > Thanking You, > Chamal. > -- James A. N. Staufferhttp://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Writing logs to several files
I don't know how to write to different files. However you can use the jamon appender to 'tail' the most recent log4j messages at the different levels via seperate sortable/searchable web pages. More on the JAMonAppender 1) Count the each total number of calls to the log4j levels (DEBUG/INFO/WARN/ERROR/FATAL) 2) Keep a buffer of the last 500 messages of each level 3) All of these are viewable in searchable/sortable web pages via jamon.war 4) simply make jamon-2.6.jar available and install jamon.war for viewing of statistics, and add the jamonappender to your log4j.xml file 5) look at the screen snapshots and the live demo below and these capabilities will become clearer 6) Live demo: http://ssouza.kgbinternet.com/jamon/menu.jsp 7) sample log4j xml file: http://jamonapi.sourceforge.net/log4j_jamonappender.xml 8) more info on jamon log4j appender: http://jamonapi.sourceforge.net/log4j_jamonappender.html 9) http://www.jamonapi.com On 8/11/07, Chamal De Silva <[EMAIL PROTECTED]> wrote: > > Hi, > > I am using RollingFileAppender. > This is my log4j properties file. > > log4j.rootLogger=debug, R > log4j.appender.R=org.apache.log4j.RollingFileAppender > log4j.appender.R.File=syslog.log > log4j.appender.R.MaxFileSize=100KB > log4j.appender.R.MaxBackupIndex=5 > log4j.appender.R.layout=org.apache.log4j.PatternLayout > log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n > > But I want to write debug messages to a file called sysdebug.log, info > messages to sysinfo.log and errors to syserror.log. Please tell me how to > do this. > > Thanking You, > Chamal. >
Writing logs to several files
Hi, I am using RollingFileAppender. This is my log4j properties file. log4j.rootLogger=debug, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=syslog.log log4j.appender.R.MaxFileSize=100KB log4j.appender.R.MaxBackupIndex=5 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n But I want to write debug messages to a file called sysdebug.log, info messages to sysinfo.log and errors to syserror.log. Please tell me how to do this. Thanking You, Chamal.