• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Log4j won't add files into index

Below is the content of my log4j.properties. Why it only index the log until upuw-app.log.1 and not until upuw-app.log.5? I tried to even create the .2 till .5 files and give chmod of 0777 but still it won't add into the files.

# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=INFO, STDOUT, ROLLING

# STDOUT is set to be a ConsoleAppender.
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
log4j.appender.STDOUT.layout.ConversionPattern=[%-5p] [%d{dd MMM yyyy HH:mm:ss,SSS}] %c: %m%n

# LOG1 is set to be a RollingFileAppender.
log4j.appender.ROLLING.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLING.layout.ConversionPattern=[%-5p] [%d{dd MMM yyyy HH:mm:ss,SSS}] %c: %m%n
log4j.appender.ROLLING=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING.File=//home//uplayuwi//public_html//Games//upuw-app-sub.log
log4j.appender.ROLLING.MaxFileSize=1000KB
log4j.appender.R.MaxBackupIndex=5

# Debug for com.upuw package
log4j.logger.com.upuw=DEBUG



0
melwong
Asked:
melwong
  • 2
1 Solution
 
kadabaCommented:
log4j.appender.R.MaxBackupIndex=5

should be

log4j.appender.ROLLING.MaxBackupIndex=5
0
 
melwongAuthor Commented:
yup i tot so. still waiting for log to log more to see result.
0
 
kadabaCommented:
at the first instance everything looks fine apart from what I mentioned...

also you could use
log4j.appender.ROLLING.MaxFileSize=1MB

instead of saying 1000KB, no harm just a better representation. :)
0
 
cmalakarCommented:
After the change .. as told by kadaba in first comment.. it should have worked.

Try to put less log file size.. like 1KB... and Verify
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now