Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Only keep one hour of old CDN logs
Browse files Browse the repository at this point in the history
CDN logs are archived to S3.  The only reason we send them to our
monitoring server is so that we have real-time logs if necessary, as
there's a 15-minute lag on them being sent to S3 by Fastly.

Given that we're not archiving logs here, there's no more to keep more
than the bare minimum.  The previous hour's logs could be useful if
you're investigating something in real-time, so only keep one
rotation.
  • Loading branch information
barrucadu committed Nov 7, 2018
1 parent f4ba457 commit cd708f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/govuk_cdnlogs/spec/classes/govuk_cdnlogs_spec.rb
Expand Up @@ -103,7 +103,7 @@
it 'should rotate the giraffe logs hourly' do
is_expected.to contain_file('/etc/logrotate.cdn_logs_hourly.conf')
.with_content(%r{^/tmp/logs/cdn-giraffe\.log$})
.with_content(/rotate 3/)
.with_content(/rotate 1/)
end

it 'should rotate the elephant logs hourly' do
Expand Down
Expand Up @@ -8,7 +8,7 @@ to_rotate_hourly.map { |name| "#{ @log_dir }/cdn-#{ name }.log" }.join("\n")

{
su root deploy
rotate 3
rotate 1
dateext
dateformat -%Y%m%d-%s
compress
Expand Down

0 comments on commit cd708f4

Please sign in to comment.