Uploaded image for project: 'FOLIO'
  1. FOLIO
  2. FOLIO-2511

SPIKE: investigate JSON layout to Okapi and RMB logs

    XMLWordPrintable

Details

    • CP: sprint 90, CP: sprint 91, CP: sprint 92, CP: sprint 94, CP: sprint 95
    • 3
    • Core: Platform

    Description

      Goal

      Investigate if JSON format can be used to provider structured logs in FOLIO, both for Okapi and backend modules (with RMB providing default logging configuration).

      If successful JSON format will be used to provide structured data in the logs. The following fields are candidates for inclusion:

      • logLevel
      • timestamp
      • message
      • stacktrace - plain text joined by \n symbol (for errors)
      • tenantId
      • moduleId (e.g mod-authtoken-1.2.3)
      • requestId
      • userId
      • uri (e.g /inventory-storage/instances) e.g an HTTP API path
      • queryString as a separate element to capture HTTP parameters
      • code (e.g 200, 400, 500) e.g an HTTP response code
      • duration (e.g 1234, in msecs) time it took to complete an operation
      • sql SQL Query

      A complete set is still being discussed, see https://wiki.folio.org/pages/viewpage.action?pageId=36579228

      Caveats

      FOLIO DevOps team has been experimenting with JSON logging configuration and have seen the following issues trying to enable JSON logging:

      • poor performance when using the "location" information (like class)
      • disappearance of existing structured fields when adding custom fields

      See details of this investigation below.

      Implementation

      We will put utilities (e.g FolioLoggingContext) and default log4j config in a shared project (okapi-common since it's used by RMB and will make the classes available in all RMB projects).

      We will let module developers know to remove their existing log4j configuration to make use of the default one. They will be also able to use the default one as a starting point and put in additional customize.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                mikhail.fokanov Mikhail Fokanov
                jakub Jakub Skoczen
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases