Skip to content

what is recommended log level for org.springframework packages #23199

Closed as not planned

Description

@boojongmin

when I destroy bean, I can not check error log.

my logback configuration is

<logger name="com.company" level="DEBUG"/>
 <root level="ERROR">
     <appender-ref ref="STDOUT" />
 </root>

bean destroy method

@PreDestroy
void destory() {
  throw new RuntimeException("message");
}

console log

09:27:45.932 [Thread-8] INFO  o.s.b.f.s.DisposableBeanAdapter - Destroy method 'destroy' on bean with name 'sqsReceiver' threw an exception: java.lang.RuntimeException: message

I couldn't see logs because my configuration of 'org.springframework' is 'ERROR'.
I waste lots of time on debugging.

would you explain spring logging rules?

and i think configuration for log level might be "warn" or "error" rather than log lovel "info".(DisposableBeanAdapter invokeCustomDestroyMethod)

I pull requested to #23200

Activity

  1. added
    status: waiting-for-triage
    on Jun 27, 2019
  2. changed the title [-]what is recommend log level for org.springframework packages[/-] [+]what is recommended log level for org.springframework packages[/+] on Jun 27, 2019
  3. added
    in: core
    on Jun 27, 2019
  4. snicoll commented on Sep 20, 2023

    @snicoll
    Member

    The related PR was merged. The framework tries to be a good citizen so that WARN is a reasonable tradeoff. The level you apply depends certainly on the environment and the lifecycle of the application.

  5. added
    status: superseded
    and removed
    status: waiting-for-triage
    on Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: corestatus: superseded

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions