Announcement Announcement Module
Collapse
No announcement yet.
Dynamically changing logging level? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamically changing logging level?

    I deploy an application to servers using an EAR file. Most all of the documentation for changing the logging level involves modifying the XML, which in my case is a lengthy redeploy via EAR, which also restarts the server.

    So, without changing the XML configuration files, how do you change the logging level?

  • #2
    My best guess at the moment is:

    for each (log in LogManager.getCurrentLoggers())
    log.setLevel(Level.DEBUG)

    Will try that out on monday.

    Comment


    • #3
      How does the question relate to spring? You should check documentation of the logging framework you're using

      Comment


      • #4
        Originally posted by denis.zhdanov View Post
        How does the question relate to spring? You should check documentation of the logging framework you're using
        Apologies; it's setup through applicationContext.xml in Spring, and can't be autorefreshed using the config setting, as that spawns a thread that never quite dies.

        That said, since it was setup in Spring, I was hoping for some Spring-centric way of doing it. Sorry for the extraneous post!

        Comment


        • #5
          Originally posted by talldean View Post
          Apologies; it's setup through applicationContext.xml in Spring, and can't be autorefreshed using the config setting, as that spawns a thread that never quite dies.

          That said, since it was setup in Spring, I was hoping for some Spring-centric way of doing it. Sorry for the extraneous post!
          Spring still doesn't relate to the question

          Every logging framework I know offers programmatic configuration facility. So, you can just create a bean that is exposed to the client and allows to set given log level to the logger with the given name.

          Comment

          Working...
          X