wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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.
 
Consider Paul's rocket mass heater.
 
subject: Logger don't write info and debug in Log file
 
Similar Threads
How to use different logging in different packages with log4j?
No logs from log4J on Server
Can't able to write errors/exception in file using log4j
thread safe logging in a servlet
Need help with log4j logging tool to log into database