Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
joshattr opened this issue Dec 2, 2015 · 6 comments
Closed

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

joshattr opened this issue Dec 2, 2015 · 6 comments

Comments

@joshattr
Copy link

joshattr commented Dec 2, 2015

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 2, 2015
@snicoll
Copy link
Member

snicoll commented Dec 8, 2015

I'd rather go with the second part of the issue than the first unless I misunderstood it. The fact that you don't get CONFIG and FINERlevel with the abstraction sounds "alright" to me. The abstraction goes with a reasonable amount of logging levels that match pretty much every logging library out there (sic) but for some reason JUL decided to go crazy about this.

Having said that, if you write logging.level.com.acme.foo=CONFIG we might translate that properly for JUL but then you're using that infrastructure for configuration purposes and not for the abstraction.

@snicoll snicoll added for: team-attention An issue we'd like other members of the team to review and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 8, 2015
@joshattr
Copy link
Author

joshattr commented Dec 8, 2015

The config v abstraction makes sense to me. Less control over your logging library is fine, but I don't think dropping logs is. How about merging CONFIG into DEBUG and FINER into TRACE?

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed for: team-attention An issue we'd like other members of the team to review labels Dec 9, 2015
@snicoll
Copy link
Member

snicoll commented Dec 9, 2015

On a more closer look (thanks @wilkinsona), CONFIG is between INFO and FINE and FINER is between FINE and FINEST. Since we map FINEST (to TRACE), I don't really see how we could "drop logs". Can you please share an example that shows that logs are dropped.

As for allowing logging library specific log level in the abstraction we decided not to do that for the reason I mentioned (using the infrastructure for configuration purposes).

@joshattr
Copy link
Author

I'll try to spin up an example sometime in Jan when my projects calm down a bit. I might be wrong 😄

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 10, 2015
@philwebb philwebb added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Dec 11, 2015
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Dec 18, 2015
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Dec 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants