Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-6129

Allow to configure logging of health check result entries to log file

    XMLWordPrintableJSON

    Details

      Description

      ResultLog (and even more so FormattingResultLog) provide the ability to add entries to the health check result. By default this is not also logged to the regular log file (as usually this is consumed by the health check client). For certain health checks it can be useful to log the exact same messages to a regular log file - that way it is not necessary to duplicate logs in the HC implementation classes (today it is quite common to log-file-logging combined with HC-result-logging in one HC which bloats the code unnecessarily).

      To ensure the log messages arrive synchronously in the log file the logging has to happen in [1] (and not in the HC executor that only gets to see the result once it's completed).

      The shall be implemented opt-in (to not surprise existing users) via a configuration property in the HC executor (to get that config status to ResultLog a system property can be used). The be able to fine control what health checks log messages are logged at what level, the the prefix "healthchecks." shall be used, e.g. "healthchecks.com.mycorp.myplatform.mymodule.ModuleCheck". That way it is easy to generate log file with all health check messages or with health check messages of certain modules.

      [1] http://svn.apache.org/viewvc/felix/trunk/healthcheck/api/src/main/java/org/apache/felix/hc/api/ResultLog.java?view=markup&pathrev=1853224#l112

        Attachments

          Activity

            People

            • Assignee:
              henzlerg Georg Henzler
              Reporter:
              henzlerg Georg Henzler
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: