Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-32836

Add a way to add appenders to loggers configured with @LoggerLevel

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2025.x, 2023.17
    • Component/s: Tests
    • Release Notes Summary:
      You can now configure additional appenders to loggers configure with @LoggerLevel in tests
    • Release Notes Description:
      Hide

      Loggers configured with help of @LoggerLevel in tests can now receive additional appenders. The resulting logger has additivity enabled and so the configured appenders are added to the existing one (the file appender that logs DEBUG logs and higher to target/trace.log and the console appender that logs WARN logs and higher to the console).

      For example, the following logger will print INFO logs to the console:

      @LoggerLevel(klass = DBSSession.class, level = "TRACE", appenders = NuxeoLoggingConstants.APPENDER_CONSOLE_INFO)
      

      Thus, you will have slow DBS queries printed to the console.

      Show
      Loggers configured with help of @LoggerLevel in tests can now receive additional appenders. The resulting logger has additivity enabled and so the configured appenders are added to the existing one (the file appender that logs DEBUG logs and higher to target/trace.log and the console appender that logs WARN logs and higher to the console). For example, the following logger will print INFO logs to the console: @LoggerLevel(klass = DBSSession.class, level = "TRACE" , appenders = NuxeoLoggingConstants.APPENDER_CONSOLE_INFO) Thus, you will have slow DBS queries printed to the console.
    • Tags:
    • Team:
      PLATFORM
    • Sprint:
      nxplatform #119
    • Story Points:
      2

      Description

      We sometime need to print logs with level lower than WARN to the console in tests.

      It can be useful for quickly debugging a test, or providing contextual information at INFO level for instance.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: