-
Notifications
You must be signed in to change notification settings - Fork 226
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: make syslog logging useable #411
base: main
Are you sure you want to change the base?
feat: make syslog logging useable #411
Conversation
* do not log an empty new line when writing to syslog * allow operator to configure truncation on syslog
2b167c2
to
d162cdc
Compare
I forgot to update the breaking change indicator after pushing my latest change. This is technically breaking because we move from the BSD-style syslog format which is not standardised to the RFC5424 format. I'm not sure how man people actually use the syslog implementation today, over UDP each log line also inserts an empty log line due to the (previously dedicated) call to |
daa0620
to
d531333
Compare
The go standard library implementation of log/syslog has been abandoned and is no longer maintained. In our tests with syslog logging in gorouter we noticed a significant performance penalty over file based logging. However, with file based logging we frequently observe broken logs because logrotate interferes with log reading / writing. This commit inlines the relevant file from log/syslog and refactors the implementation to be on-par with the file based logging. Co-authored-by: Alexander Lais <[email protected]>
d531333
to
2aa3eba
Compare
Discussion in slack here: https://cloudfoundry.slack.com/archives/C02HNDJB31R/p1732140514501099 |
The old format looks something like this:
and the new format is something like this:
|
For testing use this config:
|
I've also opened cloudfoundry/routing-release#446 |
Summary
This PR corrects and improves the direct-to-syslog logging of access logs for Gorouter.
The syslog implementation in Go has not been maintained by the Go authors since around 2015. While there are forks of the syslog code, all of them are also dormant. This PR inlines and significantly rewrites the syslog implementation, focusing on the following performance improvements:
Limitations:
Backward Compatibility
Breaking Change? Yes