Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1298

enabling debug logging via "swarm.logging.category" system property results in double log messages

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017.5.0
    • Component/s: None
    • Labels:
      None

      Description

      If I use -Dswarm.logging.category.name=DEBUG to enable debug logging, I get each of the debug log messages twice. This appears e.g. in the ArqLoggingLevelsTest test.

      The ultimate reason is that LoggingFraction.applyDefaults(Level), which adds the logger to the WildFly logging subsystem, configures a handler for the logger. The thing is that by default, log messages are already sent to the parent's logger handlers, so in combination, the log message gets sent to 2 handers.

      I see 2 possible options:

      • remove the l.handler(CONSOLE) part
      • add l.useParentHandlers(false)

      I guess both of them have the same advantages and disadvantages, so I'll just send a PR with the first solution (which is how adding loggers is typically done in WildFly).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                lthon Ladislav Thon
                Reporter:
                lthon Ladislav Thon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: