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 Beginning Java and the fly likes problem with java logging 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 » Beginning Java
Bookmark "problem with java logging" Watch "problem with java logging" New topic
Author

problem with java logging

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 130
Hi
i am trying to get a simple java program for testing java logging, but it is not working as expected,
I am attaching the code below, the problem is i am not getting fine, finner, finnest, config messages on my Console


A$HI$H
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Did you try setting the level on the Logger, too?
ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 130
Yes
i did try that also
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
It printed out all levels when I set levels on the handler and the logger. Small tweak to for loop to get the code to compile.

ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 130
hi
thanx, i dont know why it not working before, now it worked.
it is one of those things with no explanation..i guess

Ashish
Michael Remijan
Author
Ranch Hand

Joined: May 29, 2002
Posts: 120
    
    5

I use Java's logging because it's built in so I don't need to depend on a log4j jar file, but it does do some funny stuff. The problem you have is java LOGGERS and HANDLERS both have log levels!!! If your handler is set to INFO and you change your logger to DEBUG you're still only going to get INFO messages because that's what the handler is set at. Personally I think this is really bad and confusing but it's what we got. The easiest thing to do is set your handlers to level ALL that way all messages are controlled by the log level in the LOGGER object.


Java EE Evangelist — Author, EJB 3 in Action 2nd Edition — Java Community Process Member
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with java logging
 
Similar Threads
Logging "FINEST" messages using java Logger
Java Logger Puzzle
Java logging API
Java Logging API
logger for multi threaded multi class application