-
Notifications
You must be signed in to change notification settings - Fork 1.2k
syslog configuration update for log4j2 #10980
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
base: 4.20
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10980 +/- ##
=============================================
- Coverage 16.14% 4.00% -12.15%
=============================================
Files 5656 402 -5254
Lines 497893 32608 -465285
Branches 60374 5789 -54585
=============================================
- Hits 80391 1305 -79086
+ Misses 408540 31154 -377386
+ Partials 8962 149 -8813
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@DaanHoogland |
will do, work in prgress though (untested as of yet) |
ff1513c
to
1d05589
Compare
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.
Pull Request Overview
This PR updates the syslog configuration files for both the server and client by modifying the log4j 2 settings. The key changes include the addition of new attributes (port, protocol, appName) to the Syslog element, and the removal of the existing ThresholdFilter and PatternLayout configurations.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
server/conf/log4j-cloud.xml.in | Updated the Syslog element by adding port, protocol, and appName while removing filtering and layout elements |
client/conf/log4j-cloud.xml.in | Updated the Syslog element similarly with new port, protocol, and appName attributes |
Comments suppressed due to low confidence (2)
server/conf/log4j-cloud.xml.in:59
- The removal of the ThresholdFilter and PatternLayout elements may lead to unfiltered or unformatted logs. Please confirm that this change is intentional and that the new configuration provides the necessary log filtering.
<Syslog name="SYSLOG" host="localhost" port="514" protocol="UDP" appName="ApacheCloudStack" facility="LOCAL6">
client/conf/log4j-cloud.xml.in:53
- The new syslog configuration has removed the ThresholdFilter and PatternLayout settings, which might affect log filtering and formatting. Verify that the intended logging behavior is preserved under this new configuration.
<Syslog name="SYSLOG" host="localhost" port="514" protocol="UDP" appName="ApacheCloudStack" facility="LOCAL6">
@@ -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"/> |
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.
@DaanHoogland is there a reason to remove the pattern and threshold?
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.
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.
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.
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.
@blueorangutan package |
@paulgosden a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13690 |
Co-authored-by: João Jandre <[email protected]>
Co-authored-by: João Jandre <[email protected]>
@blueorangutan package |
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13767 |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13776 |
Description
This PR updates the syslog configuration log4j 2. The configuration as was includes non-existent elements and seems incomplete.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
On a server the lines as in this PR were changed and rsyslog was configured with the imtcp module. Messages would then appear in /various/log/messages
How did you try to break this feature and the system with this change?