Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions client/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ under the License.
<!-- Append warnings+ to the syslog if it is listening on UDP port -->
<!-- ============================== -->

<Syslog name="SYSLOG" host="localhost" facility="LOCAL6">
<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%d{DEFAULT} %-5p [%c{1.}] (%t:%x) (logid:%X{logcontextid}) %m%ex{filters(${filters})}%n"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaanHoogland is there a reason to remove the pattern and threshold?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, these do not work and I cannot find them in the log4j2 documentation. The empty Syslog works, so I am keeping it as simple as possible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the documentation, the Syslog appender accepts a Filter and a Layout, same as the other appenders that are defined in this file (see https://logging.apache.org/log4j/2.12.x/manual/appenders.html#SyslogAppender).
In my env I see that the logs are not being appended to syslog, but that is because it is not listening for it. If I configure it to listen on port 514, and add the port="514" protocol="UDP" configuration on the log4j2 xml it starts working.

<Syslog name="SYSLOG" host="localhost" port="514" protocol="UDP" appName="ApacheCloudStack" facility="LOCAL6">
</Syslog>

<!-- ============================== -->
Expand Down
5 changes: 1 addition & 4 deletions server/conf/log4j-cloud.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ under the License.
<!-- Append warnings+ to the syslog if it is listening on UDP port -->
<!-- ============================== -->


<Syslog name="SYSLOG" host="localhost" facility="LOCAL6">
<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-5p [%c{1.}] (%t:%x) %m%ex%n"/>
<Syslog name="SYSLOG" host="localhost" port="514" protocol="UDP" appName="ApacheCloudStack" facility="LOCAL6">
</Syslog>

<!-- ============================== -->
Expand Down
Loading