?
Solved

Log4j won't add files into index

Posted on 2009-12-16
4
Medium Priority
?
283 Views
Last Modified: 2013-11-24
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
Comment
Question by:melwong
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
kadaba earned 500 total points
ID: 26061412
log4j.appender.R.MaxBackupIndex=5

should be

log4j.appender.ROLLING.MaxBackupIndex=5
0
 

Author Comment

by:melwong
ID: 26061453
yup i tot so. still waiting for log to log more to see result.
0
 
LVL 22

Expert Comment

by:kadaba
ID: 26061469
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
 
LVL 23

Expert Comment

by:cmalakar
ID: 26061865
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question