diff --git a/modules/setup-dev-environment/pages/logging.adoc b/modules/setup-dev-environment/pages/logging.adoc index e35a4cf82f..10324b572d 100644 --- a/modules/setup-dev-environment/pages/logging.adoc +++ b/modules/setup-dev-environment/pages/logging.adoc @@ -69,7 +69,64 @@ req.correlationId.attributeName track.correlationId req.correlationId.headerName X-Correlation-ID ---- -This properties could be update in the console-config.properties file. You need to use the setup tool provided in `workspace/tomcat/setup/` to update `console-config.properties`. +These properties can be updated in the console-config.properties file. You need to use the setup tool provided in `workspace/tomcat/setup/` to update `console-config.properties`. + + +==== Use JSON format for logs + +The default configuration contains an unused `Console-JSON` appender which formats logs as JSON. + +[source, xml] +---- + + + + + + + + + +---- + +To use it, you can update the `AppenderRef` in the `Loggers` block or add a new one. + +[source, xml] +---- + + + + + +---- + +==== Stream logs to a remote server + +You need to declare a Socket appender in `log4j-appenders.xml` to stream to a remote server. You can choose to use Socket with various formats, such as JSONLayout or PatternLayout. + +As example, this configuration is used to stream JSON-formatted log entries to a remote server, such as Logstash, for further processing and analysis. + +[source, xml] +---- + + + + + +---- + +Then, do not forget to reference this new appender in `Loggers` block: + +[source, xml] +---- + + + + + + + +---- === Bonita Studio