Skip to content

Commit

Permalink
Improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminParisel committed Jan 8, 2025
1 parent a0e21de commit d087c49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/setup-dev-environment/pages/logging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ Here is an example of the Log4j2 configuration for the logger used in the exampl

==== 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.
You need to declare a Socket appender in `log4j-appenders.xml` to stream to a remote server. You can choose to use Socket with JSONLayout or PatternLayout.

This configuration is used to stream JSON-formatted log entries to a remote server, such as Logstash, for further processing and analysis.
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]
----
<Socket name="runtimeLogStream" host="<host>" port="<port>">
<Socket name="runtimeLogSocket" host="<host>" port="<port>">
<JSONLayout compact="true" eventEol="true" properties="true" stacktraceAsString="true">
<KeyValuePair key="timestamp" value="$${date:yyyy-MM-dd'T'HH:mm:ss.SSSZ}"/>
</JSONLayout>
Expand All @@ -69,7 +69,7 @@ Then you need to add in `Loggers` block this new appender:
<Loggers>
<Root level="INFO">
<!-- [...] -->
<AppenderRef ref="runtimeLogStream"/> <!-- Add this AppenderRef -->
<AppenderRef ref="runtimeLogSocket"/> <!-- Add this AppenderRef -->
<!-- [...] -->
</Root>
</Loggers>
Expand Down

0 comments on commit d087c49

Please sign in to comment.