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

feat: support syslog message truncation #447

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions jobs/gorouter/spec
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ properties:
router.logging.syslog_tag:
description: "Tag to use when writing syslog messages"
default: "vcap.gorouter"
router.logging.syslog_message_limit:
description: "Limit the number of bytes per access log written to syslog. A value of zero disables the limit."
default: 0
router.logging.syslog_addr:
description: "Address of a syslog server to send access logs"
default: "localhost:514"
Expand Down
1 change: 1 addition & 0 deletions jobs/gorouter/templates/gorouter.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ end

params['logging'] = {
'syslog' => p('router.logging.syslog_tag'),
'syslog_truncate' => p('router.logging.syslog_message_limit'),
'syslog_addr' => p('router.logging.syslog_addr'),
'syslog_network' => p('router.logging.syslog_network'),
'level' => p('router.logging_level'),
Expand Down
13 changes: 13 additions & 0 deletions spec/gorouter_templates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,19 @@
expect(parsed_yaml['logging']['syslog_network']).to eq('tcp')
end
end
context 'when syslog message length is set' do
before do
deployment_manifest_fragment['router']['logging'] = { 'syslog_message_limit' => 4096 }
end
it 'it properly sets the value' do
expect(parsed_yaml['logging']['syslog_truncate']).to eq(4096)
end
end
context 'when syslog message length is not set' do
it 'it properly sets default values' do
expect(parsed_yaml['logging']['syslog_truncate']).to eq(0)
end
end
end
end

Expand Down