Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-33794

LogbackLogManager ERROR and WARN messages about missing log files lack context and log at the wrong level

    Details

    • Notability:
      3

      Description

      When a support zip was generated, and some log files could not be found, alarming ERROR and WARN level messages were printed into the nexus.log:

      2022-06-29 11:11:36,483+0000 ERROR [qtp282991469-95] 00006821 org.sonatype.nexus.internal.log.LogbackLogManager - Unable to find log file
      2022-06-29 11:11:36,484+0000 WARN [qtp282991469-95] 00006821 org.sonatype.nexus.internal.log.LogbackLogManager - Log file does not exist

      Problem and Expectations

      Log level is alarming and likely does not need to be. Do not use WARN or ERROR level logs for INFO level messages. If these messages do suggest a truly unexpected problem, then a lot more context about why needs to be added to the messages printed. Otherwise these should be INFO level ( NOT DEBUG since this is for generating a support zip where we want to know if something went wrong)

      Also, never print a log message without context, regardless of level. In this case at minimum the context is the path to the file that could not be found. Also why it could not be found might also be included ( permission problem? dir does not exist? file does not exist? IO Exception? etc..). The lack of context in this case might be indirectly caused by the way streams are being used for null checking.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Michael Oliverio Michael Oliverio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title