This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Logger don Watch "Logger don New topic

Logger don't write info and debug in Log file

Pankaj Kr. Singh
Ranch Hand

Joined: Mar 31, 2011
Posts: 32

My Log4j properties file is as follows. It creates the log file but i get nothing which i have writter in 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.

# 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.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n

Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146


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

Hope this works

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


I tried but this doesn't workout the problem.
I agree. Here's the link:
subject: Logger don't write info and debug in Log file
Similar Threads
thread safe logging in a servlet
Need help with log4j logging tool to log into database
How to use different logging in different packages with log4j?
Can't able to write errors/exception in file using log4j
No logs from log4J on Server