Skip to content

Drops CONFIG and FINER log levels of java.util.logging #4663

Closed
@joshattr

Description

@joshattr

Spring boot appears to drop log statements logged with a CONFIG or FINER level using java.util.logging. I might be reading the source wrong here, and I'm unsure how to confirm this because it also doesn't let you log lower than INFO, as I understand it (I have been able to confirm this be adding log.levels.ROOT=DEBUG to my application.properties and not seeing my logs with a level of FINE/FINER/FINEST).

Here's where I think the problem is:

levels.put(LogLevel.TRACE, Level.FINEST);
levels.put(LogLevel.DEBUG, Level.FINE);
levels.put(LogLevel.INFO, Level.INFO);
levels.put(LogLevel.WARN, Level.WARNING);
levels.put(LogLevel.ERROR, Level.SEVERE);
levels.put(LogLevel.FATAL, Level.SEVERE);
levels.put(LogLevel.OFF, Level.OFF);

As an aside, wouldn't it be good if log levels were respected across logging libraries? That way you could still configure all libraries to use a certain level, but you could configure your specific library to behave the way you expect, given the logging library it's using. By defining your own levels that don't at least translate 1-1 with the library that has the most logging levels (which appears to be java.util.logging, but might be something else), you necessarily lose precision, and probably get more/less logging than you expected when using that library. This is a separate issue than the above two paragraphs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions