buzzsawddog
buzzsawddog

Reputation: 662

Why is INFO logged but not FINEST

I have set my logging.properties with the following and restarted tomcat: com.example.handler.level = FINEST

And I have a method of:

public SearchHistoryItem getSearchHistoryItem(Api1 api1, String stringId, String resultId) {
    SearchHistoryItem item = api1.getSearchHistoryDetails(stringId, resultId);
    Level level = logger.getLevel();
    logger.log(Level.INFO, "Log level is: " + level);
    logger.log(Level.FINEST, "item is: " + item);
    return item;
  }

And a return of the following: 13-Dec-2016 18:32:53.093 INFO [ajp-nio-127.0.0.1-8009-exec-4] com.example.handler.SomeHandler.getSearchHistoryItem Log level is: FINEST

If you note. The first log message prints what I am looking for. So I see that logging is indeed FINEST, and I see that log messages are being written. But I don't see the second log message ever print. Is there something other than setting the level in the properties file that I need to worry about?

UPDATE

I am using java.util.logging.Logger with default configurations as far as I can see.

UPDATE I have been playing with this more and it seems that if I change to Level.FINE they will log. Perhaps there is something somewhere filtering out logs that are to high?

Upvotes: 0

Views: 245

Answers (1)

davidxxx
davidxxx

Reputation: 131496

I suppose your problem is with logs in the console.

The used default level for that Handler is Level.INFO. http://docs.oracle.com/javase/6/docs/api/java/util/logging/ConsoleHandler.html

With FileHandler which the used default level is Level.ALL, you would have not had the problem.

Either you set the level for ConsoleHandler programatically, either you set the it in the configuration file (https://docs.oracle.com/cd/E19717-01/819-7753/gcblo/)

This post gives more details about the question : Why are the Level.FINE logging messages not showing?

Upvotes: 1

Related Questions