• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with java logging

 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try setting the level on the Logger, too?
 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes
i did try that also
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 130
7
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic