File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Logger don't write info and debug in Log file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Logger don Watch "Logger don New topic
Author

Logger don't write info and debug in Log file

Pankaj Kr. Singh
Ranch Hand

Joined: Mar 31, 2011
Posts: 32

Hi,
My Log4j properties file is as follows. It creates the log file but i get nothing which i have writter in logger.info() and logger.debug().

Please help.


# Set root logger level to error
log4j.rootLogger=error, Console, File, info, Debug

###### Console appender definition #######

# All outputs currently set to be a ConsoleAppender.
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout

# use log4j NDC to replace %x with tenant domain / username
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %x %-5p [%c{3}] %m%n
#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n

###### File appender definition #######
log4j.appender.File=org.apache.log4j.FileAppender

log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=${catalina.home}/logs/alfresco.log
log4j.appender.File.Append=true
log4j.appender.File.DatePattern='.'yyyy-MM-dd
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.MaxFileSize=200KB
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n



Thanks
Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146

Hi,

try to do this
log4j.rootLogger=INFO, Console, File


Hope this works
Thanks


The important thing is not to stop questioning.Curiosity has its own reason for existing.
Pankaj Kr. Singh
Ranch Hand

Joined: Mar 31, 2011
Posts: 32

Hi,

I tried but this doesn't workout the problem.
 
Don't get me started about those stupid light bulbs.
 
subject: Logger don't write info and debug in Log file