-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: How to stream runtime logs as JSON ouptut to a remote server #2952
Conversation
benjaminParisel
commented
Jan 7, 2025
- Add a section on logging page to explain how to configure log4j to stream the log as JSON output to a remote server
📝 Contribution SummaryTo merge this Pull Request, you need to check your updates with the following URL. 🔗 Updated pagesNote The following pages were updated, please ensure that the display is correct: |
🎊 PR Preview 075cb65 has been successfully built and deployed to https://bonitasoft-bonita-doc-deploy-pr-2952.surge.sh 🕐 Build time: 0.01s 🤖 By surge-preview |
|
||
==== Stream logs to a remote server | ||
|
||
You need to declare a socket in `log4j-appenders.xml` with a `JSONLayout` to stream to a remote server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the SocketAppender and the JSONLayout are 2 distinct concept. You may use Socket with plain text logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would split in 2 distinct paragraphs. One about how to use the JSONLayout (which we already have in default configuration but is not used in Loggers). Another about the Socket for streaming.
Alternatively, we can also just update the log4j2-appenders.xml to add the Socket example appender. Make the appenders comments more self-explanatory.
And document here that we can add Loggers to use the appender we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion with separation of JSON & Socket concepts.
Co-authored-by: Vincent HEMERY <vincent.hemery@bonitasoft.com>