Skip to content
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

[gorouter] Syslog writer sends empty logs #405

Open
maxmoehl opened this issue Apr 18, 2024 · 2 comments
Open

[gorouter] Syslog writer sends empty logs #405

maxmoehl opened this issue Apr 18, 2024 · 2 comments

Comments

@maxmoehl
Copy link
Member

maxmoehl commented Apr 18, 2024

Current behavior

When configuring gorouter to send access logs via syslog, every log will be followed by an empty log. This is due to the access log record writing two times, once for the actual log and once for the new line (which is intended for the file writer): https://github.com/cloudfoundry/gorouter/blob/2ae1647bff83f6fdb4e45eb18ea5d0452e661e77/accesslog/schema/access_log_record.go#L358-L365

Desired behavior

When writing logs to syslog there is no need to append a new line and it should be omitted.

Affected Version

0.295.0

@maxmoehl
Copy link
Member Author

maxmoehl commented Apr 18, 2024

On a side note, it seems like cloudfoundry/gorouter#329 never really wen't into effect, the PerformTruncate option of the custom writer is never passed on to the access log writer 😄

I'd propose to adjust those writers a bit: the writer itself expects to get one access log per call to Write. When writing to file, a new line is appended and when writing to syslog we just keep the log as-is. The syslog writer can then also truncate the log at the desired length.

@maxmoehl
Copy link
Member Author

I've started cloudfoundry/gorouter#411 to address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant