Skip to content

Conversation

@gap-editor
Copy link
Contributor

In the LogFormat::apply method, the Json and Terminal variants correctly checked for a file_writer (a NonBlocking writer) and attached it to the tracing layer. However, the LogFmt variant was missing this logic, resulting in logs always being printed to stdout, even if the application was configured to write to a log file.

The Solution:
I updated the LogFormat::LogFmt match arm to check if file_writer is Some. If it is, the layer is now configured using .with_writer(writer), ensuring consistency with the other logging formats.

Previously, the `LogFormat::LogFmt` implementation ignored the provided
`file_writer` argument, causing logs to output to stdout even when file
logging was configured. This commit adds the logic to attach the
non-blocking writer to the logfmt layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant