kafbat / kafbat/ui-docs

Document how swap to structured logging

Open
#64 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
No language data
Stars
6
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Summary

Please add official guidance (and example configuration) for turning on structured, machine-readable logging in Kafka-UI. JSON logs are easier to ingest and query in modern observability stacks.

Note:

There is probably a better way to do this if the logback-spring.xml did not exist, as the default spring-boot framework has some good inbuilt default that could be controlled just via config.

You could likely even maintain current behaviour defaulting logging.pattern.console to %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%c{1}): %msg%n%throwable

Motivation / use-case

  • Teams using tools such as Loki, Elastic, Datadog, or CloudWatch Logs benefit from consistent JSON output.
  • Clear documentation would remove trial-and-error for newcomers and promote best-practice adoption.

Example working setup

Below is a minimal configuration that produces JSON logs at INFO level. It can be included as an example or starting point in the docs.

Dockerfile
FROM ghcr.io/kafbat/kafka-ui:v1.2.0

# Copy the custom config file
COPY config.yaml /opt/config.yaml

# Copy the custom Logback file
COPY logback-spring.xml /opt/logback-spring.xml
config.yaml
...
logging:
  config: /opt/logback-spring.xml

  structured:
    format:
      console: logstash

  level:
    org.springframework.security: INFO
    io.kafbat.ui.service.rbac: INFO
...
logback-spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
      <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
        <level>${CONSOLE_LOG_THRESHOLD}</level>
      </filter>
      <encoder class="org.springframework.boot.logging.logback.StructuredLogEncoder">
        <format>${CONSOLE_LOG_STRUCTURED_FORMAT}</format>
        <charset>${CONSOLE_LOG_CHARSET}</charset>
      </encoder>
    </appender>

    <root level="INFO">
      <appender-ref ref="CONSOLE"/>
    </root>

</configuration>

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find the documentation entry point in ui-docs, then review the referenced logback-spring.xml and Spring Boot structured-logging guide. Document the Docker/configuration setup shown in the issue, and consider the existing Kafka UI logging configuration; done means newcomers can enable machine-readable logs from the published guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, spring-boot
Domain
documentation, observability
Issue type
Documentation
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.