journal: Add log level argument to journal_file_rotate_suggested()

When journald is rotating a file, we'd like to log the reason at
LOG_INFO or higher instead of LOG_DEBUG. For journalctl --header,
logging the reason at a level higher than LOG_DEBUG doesn't really
make sense. To accomodate both use cases, make the log level used
by journal_file_rotate_suggested() configurable.
This commit is contained in:
Daan De Meyer
2021-10-18 15:26:06 +02:00
parent 54ccd706ba
commit c8e6e1f10d
4 changed files with 26 additions and 22 deletions
+1 -1
View File
@@ -819,7 +819,7 @@ static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, size_t n
if (!f)
return;
if (journal_file_rotate_suggested(f, s->max_file_usec)) {
if (journal_file_rotate_suggested(f, s->max_file_usec, LOG_DEBUG)) {
log_debug("%s: Journal header limits reached or header out-of-date, rotating.", f->path);
rotate = true;
}