Add support for json logging to file#4523
Conversation
|
I like the approach, but note that we default to logging to syslog. If we decide to recommend people to use the file logger, we'll need some improvements to it (e.g. reopen files on signal, to support external rotating strategies). |
|
Should we enable json logging also for syslog? Should we make it apply to all logging methods? |
1d702f9 to
f473e55
Compare
|
You'll need a rebase on this, but you did it to yourself :) |
libbeat/logp/log.go
Outdated
There was a problem hiding this comment.
The Sprintf here seems superfluous. string(bytes)?
There was a problem hiding this comment.
agree, was probably there because there was more before the refactoring ...
libbeat/logp/log.go
Outdated
There was a problem hiding this comment.
I wonder if the Sprintf, which is basically a Join, could be implemented more efficient. A benchmark between this and the strings.Join version would be interesting.
If it can be optimized, it's probably worth it so that we don't affect the performance in the debug logging case.
There was a problem hiding this comment.
@urso probably knows from the top of his head? :-D
9186fc0 to
2ab1353
Compare
CHANGELOG.asciidoc
Outdated
There was a problem hiding this comment.
A changlog entry for add_docker_metadata, is that a merge problem?
The current support is very minimal and only logs the existing log structure in json instead of plain text. In the future further support for being able to log structs and more complex events could be added. JSON logging is disabled by default.
|
Merged in the current form. |
|
Removing "needs_docs" label because the docs are added in #4931 |
The current support is very minimal and only logs the existing log structure in json instead of plain text. In the future further support for being able to log structs and more complex events could be added.
JSON logging is disabled by default and only available for file logging.
Changelog and docs are still missing. I want to discuss first if we should move forward with this.