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 Sangeeta Bhatia <sa...@bt.com> on 2008/10/13 17:03:51 UTC

Log4j stops logging

All,

I am using Log4j-Version 1.2.8, java version 1.4.2_13.
The application simply stops writing logs after sometime.
I saw a similar thread on the forum:
http://www.nabble.com/Log4j-Version---1.2.8-occasionally-stops-logging-without-any-error-message-to19580787.html#a19655737

Sorry if i am asking the same question again but this thrread wasn't
concluded.

Is this is known bug/issue and is upgrade the only option available?

log4j.properties reads as follows:
log4j.appender.jpeAppender.file=/logs/gsp2/btadminbulkload.log

#---------Non Configurable Variables ----------

log4j.rootCategory=DEBUG,jpeAppender

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=<%d{dd MMM yyyy
HH:mm:ss.SSS}>[%t] [%-5p] - %m%n


log4j.appender.jpeAppender=org.apache.log4j.RollingFileAppender

log4j.appender.jpeAppender.ImmediateFlush=true

# number of log files to keep before deleting the oldest one
log4j.appender.jpeAppender.MaxBackupIndex=5
log4j.appender.jpeAppender.MaxFileSize=10000KB

# Log message layout: date-time [thread] priority category - message
lineTerminator
log4j.appender.jpeAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.jpeAppender.layout.ConversionPattern=<%d{dd MMM yyyy
HH:mm:ss.SSS}>[%t] [%-5p] [%c] - %m%n
#log4j.rootLogger=ERROR

# Package level log specifications
# Log levels used by Log4j in ascending order are:
# debug, info, warn, error, and fatal
log4j.logger.org.apache=WARN, jpeAppender
log4j.logger.org.objectweb=WARN, jpeAppender
log4j.logger.org.enhydra=WARN, jpeAppender
log4j.logger.org.omg=WARN, jpeAppender
log4j.logger.org.springframework=WARN, jpeAppender
log4j.logger.org.displaytag=WARN, jpeAppender
log4j.logger.com.bt=DEBUG, jpeAppender


# Enables or Disables logging operations
log.debug.enabled=true
log.info.enabled=true
log.warn.enabled=true
log.error.enabled=true
log.fatal.enabled=true
log.timing.enabled=true

# Enables or Disables logging of stack trace
log.stacktrace.enabled=false

# Enables or Disables logging of stack trace in case of exception
log.exception.stacktrace.enabled=true

# Logger class
#log.logger.class=org.apache.log4j.Logger

Thanks for your time and help!

Regards,
Sangeeta
-- 
View this message in context: http://www.nabble.com/Log4j-stops-logging-tp19956418p19956418.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


Re: Log4j stops logging

Posted by Curt Arnold <ca...@apache.org>.
On Oct 13, 2008, at 10:03 AM, Sangeeta Bhatia wrote:

>
> All,
>
> I am using Log4j-Version 1.2.8, java version 1.4.2_13.
> The application simply stops writing logs after sometime.
> I saw a similar thread on the forum:
> http://www.nabble.com/Log4j-Version---1.2.8-occasionally-stops-logging-without-any-error-message-to19580787.html#a19655737
>
> Sorry if i am asking the same question again but this thrread wasn't
> concluded.
>
> Is this is known bug/issue and is upgrade the only option available?

In the earlier thread, the user had not provided a configuration file,  
so all that we knew is that some appender in a very old version of  
log4j stopped working on some unspecified operating system under some  
unspecified condition.


>
>
> log4j.properties reads as follows:
> log4j.appender.jpeAppender.file=/logs/gsp2/btadminbulkload.log
>
> #---------Non Configurable Variables ----------
>
> log4j.rootCategory=DEBUG,jpeAppender
>
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> log4j.appender.stdout.layout.ConversionPattern=<%d{dd MMM yyyy
> HH:mm:ss.SSS}>[%t] [%-5p] - %m%n
>
>
> log4j.appender.jpeAppender=org.apache.log4j.RollingFileAppender


Does the problem still occur if you use just a plain FileAppender?   
All the RollingFileAppenders have more failure options than  
FileAppenders.  The org.apache.log4j.rolling.RollingFileAppender in  
the extras companion should be more robust than the  
org.apache.log4j.RollingFileAppender, but even it still has more ways  
to go wrong.



>
>
> log4j.appender.jpeAppender.ImmediateFlush=true
>
> # number of log files to keep before deleting the oldest one
> log4j.appender.jpeAppender.MaxBackupIndex=5
> log4j.appender.jpeAppender.MaxFileSize=10000KB
>
> # Log message layout: date-time [thread] priority category - message
> lineTerminator
> log4j.appender.jpeAppender.layout=org.apache.log4j.PatternLayout
> log4j.appender.jpeAppender.layout.ConversionPattern=<%d{dd MMM yyyy
> HH:mm:ss.SSS}>[%t] [%-5p] [%c] - %m%n
> #log4j.rootLogger=ERROR
>
> # Package level log specifications
> # Log levels used by Log4j in ascending order are:
> # debug, info, warn, error, and fatal
> log4j.logger.org.apache=WARN, jpeAppender
> log4j.logger.org.objectweb=WARN, jpeAppender
> log4j.logger.org.enhydra=WARN, jpeAppender
> log4j.logger.org.omg=WARN, jpeAppender
> log4j.logger.org.springframework=WARN, jpeAppender
> log4j.logger.org.displaytag=WARN, jpeAppender
> log4j.logger.com.bt=DEBUG, jpeAppender
>


The ",jpeAppender" in previous lines is unnecessary and should result  
in duplication of messages in the log files.

>
> # Enables or Disables logging operations
> log.debug.enabled=true
> log.info.enabled=true
> log.warn.enabled=true
> log.error.enabled=true
> log.fatal.enabled=true
> log.timing.enabled=true
>
> # Enables or Disables logging of stack trace
> log.stacktrace.enabled=false
>
> # Enables or Disables logging of stack trace in case of exception
> log.exception.stacktrace.enabled=true
>
> # Logger class
> #log.logger.class=org.apache.log4j.Logger
>

I don't believe that any of these lines would be recognized by log4j.

I assume that you can reproduce the problem.  It would be helpful if  
you could perform some or all of following experiments:

a) switch from org.apache.log4j.RollingFileAppender to FileAppender.   
If you no longer see the problem, then it is likely an issue with  
org.apache.log4j.RollingFileAppender.

b) Add log4j.debug=true to the configuration file and see if there are  
any diagnostic messages to the console around the time of failure.

c) Upgrade to log4j 1.2.15 and see if the issue goes away.

d) Switch from org.apache.log4j.RollingFileAppender to  
org.apache.log4j.rolling.RollingFIleAppender.  The extras companion  
should work with log4j 1.2.8, but you will likely need to use an XML  
configuration file.

e) If you can create a simple app that demonstrates the problem,  
create a Bugzilla entry and upload the app and tell how to trigger the  
failure.  Please specify JVM version, operating system, and log4j  
versions tested.  Please test at least log4j 1.2.8 and 1.2.15.



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