You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Nageena Parveen <na...@gmail.com> on 2006/04/27 05:01:16 UTC

Logging to different files depending on level using a single user and properties file

Hi,

   Do you have ant idea how to log messages to different files depending on
levels using a single logger? in a properties file?

here is my properties file :


log4j.rootLogger=DEBUG,stdout,E,S

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.

log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

 #log4j.logger.appender.E.access = ERROR

log4j.appender.E=org.apache.log4j.RollingFileAppender

log4j.appender.E.File=error.log

log4j.appender.E.MaxFileSize=100KB

log4j.appender.E.MaxBackupIndex=1

log4j.appender.E.layout=org.apache.log4j.PatternLayout

log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n

log4j.appender.E.Threshold=ERROR;

log4j.appender.S=org.apache.log4j.RollingFileAppender

log4j.appender.S.File=stats.log

log4j.appender.S.MaxFileSize=100KB

# Keep one backup file

log4j.appender.S.MaxBackupIndex=1

log4j.appender.S.layout=org.apache.log4j.PatternLayout

log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n

log4j.appender.S.Threshold=INFO;

but this is not working.

Re: Logging to different files depending on level using a single user and properties file

Posted by James Stauffer <st...@gmail.com>.
http://logging.apache.org/log4j/docs/api/org/apache/log4j/varia/LevelRangeFilter.html

BTW, Google is your friend.  That was the 2nd link when I searched for
"log4j level range"

On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> I have no idea how to set the range.Can you help me with this?
>
>
>
> On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> >
> > There is a way to set a range of levels.  Look through the API.  That
> > might only be an option when using an XML config file.
> >
> > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > Hey,
> > >   After i removed semi colon only ERROR messages are sent to error.logbut
> > > still stat.log is getting all the messages equal to and greater than
> > > INFO,since i have set the threshold=INFO for S.
> > > What can be done to direct only INFO messages to stats.log?
> > >
> > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > >
> > > > Then it appears that the threshold isn't set correctly.  I use the XML
> > > > config format so I am not familiar with the properties format, but I
> > > > would double-check how you are setting the threshold.  One thing that
> > > > does look suspect is the semi-colon on the end of the threshold line.
> > > >
> > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > Whatever level i specify at the rootlogger, all those log messages
> > are
> > > > > logged to both the files.
> > > > > say,
> > > > > Log4j.rootLogger=INFO,E,S
> > > > >
> > > > > All the log messages equal to and above are logged to error.log and
> > > > stat.log
> > > > >
> > > > >
> > > > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > > > >
> > > > > > Does error.log get debug, info, or warn messages?
> > > > > >
> > > > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > > > Hi,
> > > > > > >  Thanks for the reply.I want to direct messages to different
> > files
> > > > > > depending
> > > > > > > on level.say, ERROR messages to error.log , INFO messages to
> > > > stats.log .
> > > > > > But
> > > > > > > I am getting all the messages in all the files.
> > > > > > >    Is there any other way i can do this in a properties file?
> > > > > > >
> > > > > > >
> > > > > > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > > > > > >
> > > > > > > > stdout should get all logs.  E should only get ERROR and FATAL
> > > > logs.
> > > > > > > > S should get everything from INFO to FATAL.  Is that different
> > > > than
> > > > > > > > what you see?
> > > > > > > >
> > > > > > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > >    Do you have ant idea how to log messages to different
> > files
> > > > > > depending
> > > > > > > > on
> > > > > > > > > levels using a single logger? in a properties file?
> > > > > > > > >
> > > > > > > > > here is my properties file :
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > log4j.rootLogger=DEBUG,stdout,E,S
> > > > > > > > >
> > > > > > > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > > > > > > >
> > > > > > > > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > > > > > > >
> > > > > > > > > # Pattern to output the caller's file name and line number.
> > > > > > > > >
> > > > > > > > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t]
> > (%F:%L)
> > > > -
> > > > > > %m%n
> > > > > > > > >
> > > > > > > > >  #log4j.logger.appender.E.access = ERROR
> > > > > > > > >
> > > > > > > > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > > > > > > > >
> > > > > > > > > log4j.appender.E.File=error.log
> > > > > > > > >
> > > > > > > > > log4j.appender.E.MaxFileSize=100KB
> > > > > > > > >
> > > > > > > > > log4j.appender.E.MaxBackupIndex=1
> > > > > > > > >
> > > > > > > > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > > > > > > > >
> > > > > > > > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > > > >
> > > > > > > > > log4j.appender.E.Threshold=ERROR;
> > > > > > > > >
> > > > > > > > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > > > > > > > >
> > > > > > > > > log4j.appender.S.File=stats.log
> > > > > > > > >
> > > > > > > > > log4j.appender.S.MaxFileSize=100KB
> > > > > > > > >
> > > > > > > > > # Keep one backup file
> > > > > > > > >
> > > > > > > > > log4j.appender.S.MaxBackupIndex=1
> > > > > > > > >
> > > > > > > > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > > > > > > > >
> > > > > > > > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > > > >
> > > > > > > > > log4j.appender.S.Threshold=INFO;
> > > > > > > > >
> > > > > > > > > but this is not working.
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > James Stauffer
> > > > > > > > Are you good? Take the test at
> > http://www.livingwaters.com/good/
> > > > > > > >
> > > > > > > >
> > > > ---------------------------------------------------------------------
> > > > > > > > To unsubscribe, e-mail:
> > log4j-user-unsubscribe@logging.apache.org
> > > > > > > > For additional commands, e-mail:
> > > > log4j-user-help@logging.apache.org
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > James Stauffer
> > > > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > > > For additional commands, e-mail:
> > log4j-user-help@logging.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > James Stauffer
> > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: Logging to different files depending on level using a single user and properties file

Posted by Nageena Parveen <na...@gmail.com>.
I have no idea how to set the range.Can you help me with this?



On 4/27/06, James Stauffer <st...@gmail.com> wrote:
>
> There is a way to set a range of levels.  Look through the API.  That
> might only be an option when using an XML config file.
>
> On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > Hey,
> >   After i removed semi colon only ERROR messages are sent to error.logbut
> > still stat.log is getting all the messages equal to and greater than
> > INFO,since i have set the threshold=INFO for S.
> > What can be done to direct only INFO messages to stats.log?
> >
> > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > >
> > > Then it appears that the threshold isn't set correctly.  I use the XML
> > > config format so I am not familiar with the properties format, but I
> > > would double-check how you are setting the threshold.  One thing that
> > > does look suspect is the semi-colon on the end of the threshold line.
> > >
> > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > Whatever level i specify at the rootlogger, all those log messages
> are
> > > > logged to both the files.
> > > > say,
> > > > Log4j.rootLogger=INFO,E,S
> > > >
> > > > All the log messages equal to and above are logged to error.log and
> > > stat.log
> > > >
> > > >
> > > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > > >
> > > > > Does error.log get debug, info, or warn messages?
> > > > >
> > > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > > Hi,
> > > > > >  Thanks for the reply.I want to direct messages to different
> files
> > > > > depending
> > > > > > on level.say, ERROR messages to error.log , INFO messages to
> > > stats.log .
> > > > > But
> > > > > > I am getting all the messages in all the files.
> > > > > >    Is there any other way i can do this in a properties file?
> > > > > >
> > > > > >
> > > > > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > > > > >
> > > > > > > stdout should get all logs.  E should only get ERROR and FATAL
> > > logs.
> > > > > > > S should get everything from INFO to FATAL.  Is that different
> > > than
> > > > > > > what you see?
> > > > > > >
> > > > > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > >    Do you have ant idea how to log messages to different
> files
> > > > > depending
> > > > > > > on
> > > > > > > > levels using a single logger? in a properties file?
> > > > > > > >
> > > > > > > > here is my properties file :
> > > > > > > >
> > > > > > > >
> > > > > > > > log4j.rootLogger=DEBUG,stdout,E,S
> > > > > > > >
> > > > > > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > > > > > >
> > > > > > > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > > > > > >
> > > > > > > > # Pattern to output the caller's file name and line number.
> > > > > > > >
> > > > > > > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t]
> (%F:%L)
> > > -
> > > > > %m%n
> > > > > > > >
> > > > > > > >  #log4j.logger.appender.E.access = ERROR
> > > > > > > >
> > > > > > > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > > > > > > >
> > > > > > > > log4j.appender.E.File=error.log
> > > > > > > >
> > > > > > > > log4j.appender.E.MaxFileSize=100KB
> > > > > > > >
> > > > > > > > log4j.appender.E.MaxBackupIndex=1
> > > > > > > >
> > > > > > > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > > > > > > >
> > > > > > > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > > >
> > > > > > > > log4j.appender.E.Threshold=ERROR;
> > > > > > > >
> > > > > > > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > > > > > > >
> > > > > > > > log4j.appender.S.File=stats.log
> > > > > > > >
> > > > > > > > log4j.appender.S.MaxFileSize=100KB
> > > > > > > >
> > > > > > > > # Keep one backup file
> > > > > > > >
> > > > > > > > log4j.appender.S.MaxBackupIndex=1
> > > > > > > >
> > > > > > > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > > > > > > >
> > > > > > > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > > >
> > > > > > > > log4j.appender.S.Threshold=INFO;
> > > > > > > >
> > > > > > > > but this is not working.
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > James Stauffer
> > > > > > > Are you good? Take the test at
> http://www.livingwaters.com/good/
> > > > > > >
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> log4j-user-unsubscribe@logging.apache.org
> > > > > > > For additional commands, e-mail:
> > > log4j-user-help@logging.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > James Stauffer
> > > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > > For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > James Stauffer
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: Logging to different files depending on level using a single user and properties file

Posted by James Stauffer <st...@gmail.com>.
There is a way to set a range of levels.  Look through the API.  That
might only be an option when using an XML config file.

On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> Hey,
>   After i removed semi colon only ERROR messages are sent to error.log but
> still stat.log is getting all the messages equal to and greater than
> INFO,since i have set the threshold=INFO for S.
> What can be done to direct only INFO messages to stats.log?
>
> On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> >
> > Then it appears that the threshold isn't set correctly.  I use the XML
> > config format so I am not familiar with the properties format, but I
> > would double-check how you are setting the threshold.  One thing that
> > does look suspect is the semi-colon on the end of the threshold line.
> >
> > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > Whatever level i specify at the rootlogger, all those log messages are
> > > logged to both the files.
> > > say,
> > > Log4j.rootLogger=INFO,E,S
> > >
> > > All the log messages equal to and above are logged to error.log and
> > stat.log
> > >
> > >
> > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > >
> > > > Does error.log get debug, info, or warn messages?
> > > >
> > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > Hi,
> > > > >  Thanks for the reply.I want to direct messages to different files
> > > > depending
> > > > > on level.say, ERROR messages to error.log , INFO messages to
> > stats.log .
> > > > But
> > > > > I am getting all the messages in all the files.
> > > > >    Is there any other way i can do this in a properties file?
> > > > >
> > > > >
> > > > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > > > >
> > > > > > stdout should get all logs.  E should only get ERROR and FATAL
> > logs.
> > > > > > S should get everything from INFO to FATAL.  Is that different
> > than
> > > > > > what you see?
> > > > > >
> > > > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > > > Hi,
> > > > > > >
> > > > > > >    Do you have ant idea how to log messages to different files
> > > > depending
> > > > > > on
> > > > > > > levels using a single logger? in a properties file?
> > > > > > >
> > > > > > > here is my properties file :
> > > > > > >
> > > > > > >
> > > > > > > log4j.rootLogger=DEBUG,stdout,E,S
> > > > > > >
> > > > > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > > > > >
> > > > > > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > > > > >
> > > > > > > # Pattern to output the caller's file name and line number.
> > > > > > >
> > > > > > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L)
> > -
> > > > %m%n
> > > > > > >
> > > > > > >  #log4j.logger.appender.E.access = ERROR
> > > > > > >
> > > > > > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > > > > > >
> > > > > > > log4j.appender.E.File=error.log
> > > > > > >
> > > > > > > log4j.appender.E.MaxFileSize=100KB
> > > > > > >
> > > > > > > log4j.appender.E.MaxBackupIndex=1
> > > > > > >
> > > > > > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > > > > > >
> > > > > > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > >
> > > > > > > log4j.appender.E.Threshold=ERROR;
> > > > > > >
> > > > > > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > > > > > >
> > > > > > > log4j.appender.S.File=stats.log
> > > > > > >
> > > > > > > log4j.appender.S.MaxFileSize=100KB
> > > > > > >
> > > > > > > # Keep one backup file
> > > > > > >
> > > > > > > log4j.appender.S.MaxBackupIndex=1
> > > > > > >
> > > > > > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > > > > > >
> > > > > > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > > > > > >
> > > > > > > log4j.appender.S.Threshold=INFO;
> > > > > > >
> > > > > > > but this is not working.
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > James Stauffer
> > > > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > > > >
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > > > For additional commands, e-mail:
> > log4j-user-help@logging.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > James Stauffer
> > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: Logging to different files depending on level using a single user and properties file

Posted by Nageena Parveen <na...@gmail.com>.
Hey,
  After i removed semi colon only ERROR messages are sent to error.log but
still stat.log is getting all the messages equal to and greater than
INFO,since i have set the threshold=INFO for S.
What can be done to direct only INFO messages to stats.log?

On 4/27/06, James Stauffer <st...@gmail.com> wrote:
>
> Then it appears that the threshold isn't set correctly.  I use the XML
> config format so I am not familiar with the properties format, but I
> would double-check how you are setting the threshold.  One thing that
> does look suspect is the semi-colon on the end of the threshold line.
>
> On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > Whatever level i specify at the rootlogger, all those log messages are
> > logged to both the files.
> > say,
> > Log4j.rootLogger=INFO,E,S
> >
> > All the log messages equal to and above are logged to error.log and
> stat.log
> >
> >
> > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > >
> > > Does error.log get debug, info, or warn messages?
> > >
> > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > Hi,
> > > >  Thanks for the reply.I want to direct messages to different files
> > > depending
> > > > on level.say, ERROR messages to error.log , INFO messages to
> stats.log .
> > > But
> > > > I am getting all the messages in all the files.
> > > >    Is there any other way i can do this in a properties file?
> > > >
> > > >
> > > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > > >
> > > > > stdout should get all logs.  E should only get ERROR and FATAL
> logs.
> > > > > S should get everything from INFO to FATAL.  Is that different
> than
> > > > > what you see?
> > > > >
> > > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > > Hi,
> > > > > >
> > > > > >    Do you have ant idea how to log messages to different files
> > > depending
> > > > > on
> > > > > > levels using a single logger? in a properties file?
> > > > > >
> > > > > > here is my properties file :
> > > > > >
> > > > > >
> > > > > > log4j.rootLogger=DEBUG,stdout,E,S
> > > > > >
> > > > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > > > >
> > > > > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > > > >
> > > > > > # Pattern to output the caller's file name and line number.
> > > > > >
> > > > > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L)
> -
> > > %m%n
> > > > > >
> > > > > >  #log4j.logger.appender.E.access = ERROR
> > > > > >
> > > > > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > > > > >
> > > > > > log4j.appender.E.File=error.log
> > > > > >
> > > > > > log4j.appender.E.MaxFileSize=100KB
> > > > > >
> > > > > > log4j.appender.E.MaxBackupIndex=1
> > > > > >
> > > > > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > > > > >
> > > > > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > > > > >
> > > > > > log4j.appender.E.Threshold=ERROR;
> > > > > >
> > > > > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > > > > >
> > > > > > log4j.appender.S.File=stats.log
> > > > > >
> > > > > > log4j.appender.S.MaxFileSize=100KB
> > > > > >
> > > > > > # Keep one backup file
> > > > > >
> > > > > > log4j.appender.S.MaxBackupIndex=1
> > > > > >
> > > > > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > > > > >
> > > > > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > > > > >
> > > > > > log4j.appender.S.Threshold=INFO;
> > > > > >
> > > > > > but this is not working.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > James Stauffer
> > > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > > For additional commands, e-mail:
> log4j-user-help@logging.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > James Stauffer
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: Logging to different files depending on level using a single user and properties file

Posted by James Stauffer <st...@gmail.com>.
Then it appears that the threshold isn't set correctly.  I use the XML
config format so I am not familiar with the properties format, but I
would double-check how you are setting the threshold.  One thing that
does look suspect is the semi-colon on the end of the threshold line.

On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> Whatever level i specify at the rootlogger, all those log messages are
> logged to both the files.
> say,
> Log4j.rootLogger=INFO,E,S
>
> All the log messages equal to and above are logged to error.log and stat.log
>
>
> On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> >
> > Does error.log get debug, info, or warn messages?
> >
> > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > Hi,
> > >  Thanks for the reply.I want to direct messages to different files
> > depending
> > > on level.say, ERROR messages to error.log , INFO messages to stats.log .
> > But
> > > I am getting all the messages in all the files.
> > >    Is there any other way i can do this in a properties file?
> > >
> > >
> > > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > > >
> > > > stdout should get all logs.  E should only get ERROR and FATAL logs.
> > > > S should get everything from INFO to FATAL.  Is that different than
> > > > what you see?
> > > >
> > > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > > Hi,
> > > > >
> > > > >    Do you have ant idea how to log messages to different files
> > depending
> > > > on
> > > > > levels using a single logger? in a properties file?
> > > > >
> > > > > here is my properties file :
> > > > >
> > > > >
> > > > > log4j.rootLogger=DEBUG,stdout,E,S
> > > > >
> > > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > > >
> > > > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > > >
> > > > > # Pattern to output the caller's file name and line number.
> > > > >
> > > > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) -
> > %m%n
> > > > >
> > > > >  #log4j.logger.appender.E.access = ERROR
> > > > >
> > > > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > > > >
> > > > > log4j.appender.E.File=error.log
> > > > >
> > > > > log4j.appender.E.MaxFileSize=100KB
> > > > >
> > > > > log4j.appender.E.MaxBackupIndex=1
> > > > >
> > > > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > > > >
> > > > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > > > >
> > > > > log4j.appender.E.Threshold=ERROR;
> > > > >
> > > > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > > > >
> > > > > log4j.appender.S.File=stats.log
> > > > >
> > > > > log4j.appender.S.MaxFileSize=100KB
> > > > >
> > > > > # Keep one backup file
> > > > >
> > > > > log4j.appender.S.MaxBackupIndex=1
> > > > >
> > > > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > > > >
> > > > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > > > >
> > > > > log4j.appender.S.Threshold=INFO;
> > > > >
> > > > > but this is not working.
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > James Stauffer
> > > > Are you good? Take the test at http://www.livingwaters.com/good/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: Logging to different files depending on level using a single user and properties file

Posted by Nageena Parveen <na...@gmail.com>.
Whatever level i specify at the rootlogger, all those log messages are
logged to both the files.
say,
Log4j.rootLogger=INFO,E,S

All the log messages equal to and above are logged to error.log and stat.log


On 4/27/06, James Stauffer <st...@gmail.com> wrote:
>
> Does error.log get debug, info, or warn messages?
>
> On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > Hi,
> >  Thanks for the reply.I want to direct messages to different files
> depending
> > on level.say, ERROR messages to error.log , INFO messages to stats.log .
> But
> > I am getting all the messages in all the files.
> >    Is there any other way i can do this in a properties file?
> >
> >
> > On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> > >
> > > stdout should get all logs.  E should only get ERROR and FATAL logs.
> > > S should get everything from INFO to FATAL.  Is that different than
> > > what you see?
> > >
> > > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > > Hi,
> > > >
> > > >    Do you have ant idea how to log messages to different files
> depending
> > > on
> > > > levels using a single logger? in a properties file?
> > > >
> > > > here is my properties file :
> > > >
> > > >
> > > > log4j.rootLogger=DEBUG,stdout,E,S
> > > >
> > > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > > >
> > > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > > >
> > > > # Pattern to output the caller's file name and line number.
> > > >
> > > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) -
> %m%n
> > > >
> > > >  #log4j.logger.appender.E.access = ERROR
> > > >
> > > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > > >
> > > > log4j.appender.E.File=error.log
> > > >
> > > > log4j.appender.E.MaxFileSize=100KB
> > > >
> > > > log4j.appender.E.MaxBackupIndex=1
> > > >
> > > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > > >
> > > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > > >
> > > > log4j.appender.E.Threshold=ERROR;
> > > >
> > > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > > >
> > > > log4j.appender.S.File=stats.log
> > > >
> > > > log4j.appender.S.MaxFileSize=100KB
> > > >
> > > > # Keep one backup file
> > > >
> > > > log4j.appender.S.MaxBackupIndex=1
> > > >
> > > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > > >
> > > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > > >
> > > > log4j.appender.S.Threshold=INFO;
> > > >
> > > > but this is not working.
> > > >
> > > >
> > >
> > >
> > > --
> > > James Stauffer
> > > Are you good? Take the test at http://www.livingwaters.com/good/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: Logging to different files depending on level using a single user and properties file

Posted by James Stauffer <st...@gmail.com>.
Does error.log get debug, info, or warn messages?

On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> Hi,
>  Thanks for the reply.I want to direct messages to different files depending
> on level.say, ERROR messages to error.log , INFO messages to stats.log . But
> I am getting all the messages in all the files.
>    Is there any other way i can do this in a properties file?
>
>
> On 4/27/06, James Stauffer <st...@gmail.com> wrote:
> >
> > stdout should get all logs.  E should only get ERROR and FATAL logs.
> > S should get everything from INFO to FATAL.  Is that different than
> > what you see?
> >
> > On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > > Hi,
> > >
> > >    Do you have ant idea how to log messages to different files depending
> > on
> > > levels using a single logger? in a properties file?
> > >
> > > here is my properties file :
> > >
> > >
> > > log4j.rootLogger=DEBUG,stdout,E,S
> > >
> > > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> > >
> > > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> > >
> > > # Pattern to output the caller's file name and line number.
> > >
> > > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
> > >
> > >  #log4j.logger.appender.E.access = ERROR
> > >
> > > log4j.appender.E=org.apache.log4j.RollingFileAppender
> > >
> > > log4j.appender.E.File=error.log
> > >
> > > log4j.appender.E.MaxFileSize=100KB
> > >
> > > log4j.appender.E.MaxBackupIndex=1
> > >
> > > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> > >
> > > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> > >
> > > log4j.appender.E.Threshold=ERROR;
> > >
> > > log4j.appender.S=org.apache.log4j.RollingFileAppender
> > >
> > > log4j.appender.S.File=stats.log
> > >
> > > log4j.appender.S.MaxFileSize=100KB
> > >
> > > # Keep one backup file
> > >
> > > log4j.appender.S.MaxBackupIndex=1
> > >
> > > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> > >
> > > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> > >
> > > log4j.appender.S.Threshold=INFO;
> > >
> > > but this is not working.
> > >
> > >
> >
> >
> > --
> > James Stauffer
> > Are you good? Take the test at http://www.livingwaters.com/good/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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


Re: Logging to different files depending on level using a single user and properties file

Posted by Nageena Parveen <na...@gmail.com>.
Hi,
 Thanks for the reply.I want to direct messages to different files depending
on level.say, ERROR messages to error.log , INFO messages to stats.log . But
I am getting all the messages in all the files.
   Is there any other way i can do this in a properties file?


On 4/27/06, James Stauffer <st...@gmail.com> wrote:
>
> stdout should get all logs.  E should only get ERROR and FATAL logs.
> S should get everything from INFO to FATAL.  Is that different than
> what you see?
>
> On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> > Hi,
> >
> >    Do you have ant idea how to log messages to different files depending
> on
> > levels using a single logger? in a properties file?
> >
> > here is my properties file :
> >
> >
> > log4j.rootLogger=DEBUG,stdout,E,S
> >
> > log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> >
> > log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> >
> > # Pattern to output the caller's file name and line number.
> >
> > log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
> >
> >  #log4j.logger.appender.E.access = ERROR
> >
> > log4j.appender.E=org.apache.log4j.RollingFileAppender
> >
> > log4j.appender.E.File=error.log
> >
> > log4j.appender.E.MaxFileSize=100KB
> >
> > log4j.appender.E.MaxBackupIndex=1
> >
> > log4j.appender.E.layout=org.apache.log4j.PatternLayout
> >
> > log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
> >
> > log4j.appender.E.Threshold=ERROR;
> >
> > log4j.appender.S=org.apache.log4j.RollingFileAppender
> >
> > log4j.appender.S.File=stats.log
> >
> > log4j.appender.S.MaxFileSize=100KB
> >
> > # Keep one backup file
> >
> > log4j.appender.S.MaxBackupIndex=1
> >
> > log4j.appender.S.layout=org.apache.log4j.PatternLayout
> >
> > log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
> >
> > log4j.appender.S.Threshold=INFO;
> >
> > but this is not working.
> >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: Logging to different files depending on level using a single user and properties file

Posted by James Stauffer <st...@gmail.com>.
stdout should get all logs.  E should only get ERROR and FATAL logs. 
S should get everything from INFO to FATAL.  Is that different than
what you see?

On 4/26/06, Nageena Parveen <na...@gmail.com> wrote:
> Hi,
>
>    Do you have ant idea how to log messages to different files depending on
> levels using a single logger? in a properties file?
>
> here is my properties file :
>
>
> log4j.rootLogger=DEBUG,stdout,E,S
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>
> # Pattern to output the caller's file name and line number.
>
> log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
>
>  #log4j.logger.appender.E.access = ERROR
>
> log4j.appender.E=org.apache.log4j.RollingFileAppender
>
> log4j.appender.E.File=error.log
>
> log4j.appender.E.MaxFileSize=100KB
>
> log4j.appender.E.MaxBackupIndex=1
>
> log4j.appender.E.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.E.layout.ConversionPattern=%p %t %c - %m%n
>
> log4j.appender.E.Threshold=ERROR;
>
> log4j.appender.S=org.apache.log4j.RollingFileAppender
>
> log4j.appender.S.File=stats.log
>
> log4j.appender.S.MaxFileSize=100KB
>
> # Keep one backup file
>
> log4j.appender.S.MaxBackupIndex=1
>
> log4j.appender.S.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.S.layout.ConversionPattern=%p %t %c - %m%n
>
> log4j.appender.S.Threshold=INFO;
>
> but this is not working.
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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