Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4757

Support JSON format logging

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      More and more enterprise users request structured JSON format logging for their applications. This removes the need for configuring custom log line parsers for every application when collecting logs centrally.

      Zookeeper has flexible logging through Slf4j and Logback, for which there are several ways to achieve JSON logging. But for end users (such as helm chart user) it is very difficult to achieve. It should ideally be as simple as a configuration option.

      OpenTelemetry is a CNCF project that has become the defacto standard for metrics and traces collection. They also cover logging, and they recently standardized on ECS JSON format as their log schema for OTEL-logging. Although there are other JSON formats in use, a pragmatic option for zookeeper is to only support ECS.

      Proposed way to enable JSON logging:

      export ZOO_LOG_FORMAT=json
      bin/zkServer.sh start-foreground

      Attachments

        Activity

          People

            janhoy Jan Høydahl
            janhoy Jan Høydahl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 50m
                2h 50m