Conflicting log directives, what happens?

not that I would do this but just asking, if I have

foo.com {
    log requests.log {
	rotate_size 50  # Rotate after 50 MB
	rotate_age  90  # Keep rotated files for 90 days
	rotate_keep 20  # Keep at most 20 log files
	rotate_compress # Compress rotated log files in gzip format
   }
}

and

bar.com {
   log requests.log {
	rotate_size 25  # Rotate after 50 MB
	rotate_age  10  # Keep rotated files for 90 days
	rotate_keep 5  # Keep at most 20 log files
   }
}

foo.com has different log settings than bar.com though they both point to the same file.

What happens?

Good question. The first one will be used. :slight_smile: See logger.go and roller.go (the GetLogWriter function ensures that rollers don’t stop on each others’ toes)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.