bichon icon indicating copy to clipboard operation
bichon copied to clipboard

`BICHON_JSON_LOGS` / `--bichon-json-logs` has no effect: logs are always plain text

Open MrCasquette opened this issue 2 months ago • 0 comments

Describe the bug

The README documents BICHON_JSON_LOGS ("JSON-formatted logs for log aggregators"), but setting it to true does not change the log output: logs stay in the plain text format, both on stdout and in log files.

To reproduce

  1. Run rustmailer/bichon:latest (2.0.3) with BICHON_JSON_LOGS=true (and BICHON_ANSI_LOGS=false)
  2. Check docker logs bichon

Output:

2026-09-30T05:52:35.476+02:00  INFO poem::server: server started name="Bichon Service"

BICHON_ANSI_LOGS=false is applied (no color codes), BICHON_JSON_LOGS=true is not.

Cause

On main (a6c9b15), bichon_json_logs is declared in crates/core/src/settings/cli.rs and exposed in settings/mod.rs, but never read by the logger:

  • crates/core/src/logger/mod.rs, setup_stdout_logger() only uses bichon_ansi_logs and always builds the text formatter (tracing_subscriber::fmt::format())
  • crates/core/src/logger/file.rs does the same for the file logger

Expected behavior

With BICHON_JSON_LOGS=true, output JSON lines (e.g. via tracing_subscriber's .json() formatter, json feature), so that log aggregators such as Loki can read the level from a field instead of guessing it from the text.

Environment

  • Bichon 2.0.3, Docker image rustmailer/bichon:latest
  • Logs shipped to Loki via Grafana Alloy

MrCasquette avatar Sep 30 '26 04:09 MrCasquette