log4j RollingFileAppender

V

vishist

Hi,

We're using commons-logging and log4j implementation for logging
purpose in IBM Websphere process server 6.0.2 on Windows 2003
environment. For some strange reason, the rolling file appender is not
working. Upon looking at the source of RollingFileAppender, I found
out that at line 139 where it renames the file is failing
"file.renameTo(target)". This method is returning false, and I don't
know what to do here.

The strange thing is its working in Weblogic (Unix), and Websphere
portal server (Windows). I'd really appreciate if someone can help me
here.

thanks
Vishist.

log4j.rootLogger=DEBUG, debug, ERROR, error

log4j.configDebug=true

# Application console logs
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.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p [%t]
%c - %m%n

# Debug Log
log4j.appender.debug=org.apache.log4j.RollingFileAppender
log4j.appender.debug.File=application_debug.log
log4j.appender.debug.MaxFileSize=30KB
log4j.appender.debug.MaxBackupIndex=9
log4j.appender.debug.Threshold=DEBUG
log4j.appender.debug.layout=org.apache.log4j.PatternLayout
log4j.appender.debug.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c
- %m%n

# Error Log
log4j.appender.error=org.apache.log4j.RollingFileAppender
log4j.appender.error.File=application_error.log
log4j.appender.error.MaxFileSize=30KB
log4j.appender.error.MaxBackupIndex=9
log4j.appender.error.Threshold=ERROR
log4j.appender.error.layout=org.apache.log4j.PatternLayout
log4j.appender.error.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c
- %m%n

# Aplication
log4j.logger.debug.com=DEBUG
log4j.logger.error.com=ERROR, stdout

# All
log4j.logger.org=DEBUG
log4j.logger.net=FATAL
 
A

Arne Vajhøj

vishist said:
We're using commons-logging and log4j implementation for logging
purpose in IBM Websphere process server 6.0.2 on Windows 2003
environment. For some strange reason, the rolling file appender is not
working. Upon looking at the source of RollingFileAppender, I found
out that at line 139 where it renames the file is failing
"file.renameTo(target)". This method is returning false, and I don't
know what to do here.

The strange thing is its working in Weblogic (Unix), and Websphere
portal server (Windows). I'd really appreciate if someone can help me
here.

Start by checking for external problems: file protection, directory
protection, disk full etc..

Arne
 
V

vishist

Start by checking for external problems: file protection, directory
protection, disk full etc..

I did. I gave full permissions to "everyone" for the entire directory
and children under it [disk is not null]. Still it didn't allow. The
only plausible solution I found so far searching from net is to make a
copy of log file, create a temp file, and then copy it. Has it got to
do anything with Websphere process server?

I looked at RollingFileAppender code, and it closes the log file
specifically for Windows OS (atleast the comment says it).

thanks
Vishist.
 
A

Arne Vajhøj

vishist said:
Start by checking for external problems: file protection, directory
protection, disk full etc..

I did. I gave full permissions to "everyone" for the entire directory
and children under it [disk is not null]. Still it didn't allow. The
only plausible solution I found so far searching from net is to make a
copy of log file, create a temp file, and then copy it. Has it got to
do anything with Websphere process server?

I doubt it.

But I do not have any other ideas.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top