Skip to content
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

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

benjaminParisel
Copy link
Contributor

  • Add a section on logging page to explain how to configure log4j to stream the log as JSON output to a remote server

Copy link
Contributor

github-actions bot commented Jan 7, 2025

📝 Contribution Summary

To merge this Pull Request, you need to check your updates with the following URL.

🔗 Updated pages

Note

The following pages were updated, please ensure that the display is correct:

@bonita-ci
Copy link
Contributor

bonita-ci commented Jan 7, 2025

🎊 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.
Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor

@vhemery vhemery left a 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.

modules/setup-dev-environment/pages/logging.adoc Outdated Show resolved Hide resolved
Co-authored-by: Vincent HEMERY <vincent.hemery@bonitasoft.com>
@vhemery vhemery merged commit c12d480 into 2022.2 Jan 8, 2025
5 checks passed
@vhemery vhemery deleted the doc/log_json_output branch January 8, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants