DEFINE_STRING_TABLE_LOOKUP(storage, Storage);
DEFINE_CONFIG_PARSE_ENUM(config_parse_storage, storage, Storage, "Failed to parse storage setting");
+static const char* const split_mode_table[] = {
+ [SPLIT_NONE] = "none",
+ [SPLIT_UID] = "uid",
+ [SPLIT_LOGIN] = "login"
+};
+
+DEFINE_STRING_TABLE_LOOKUP(split_mode, SplitMode);
+DEFINE_CONFIG_PARSE_ENUM(config_parse_split_mode, split_mode, SplitMode, "Failed to parse split mode setting");
+
static uint64_t available_space(Server *s) {
char ids[33], *p;
const char *f;
Iterator i;
int r;
- log_info("Rotating...");
+ log_debug("Rotating...");
if (s->runtime_journal) {
r = journal_file_rotate(&s->runtime_journal, s->compress, false);
sd_id128_t machine;
int r;
- log_info("Vacuuming...");
+ log_debug("Vacuuming...");
r = sd_id128_get_machine(&machine);
if (r < 0) {
return;
if (journal_file_rotate_suggested(f)) {
- log_info("Journal header limits reached or header out-of-date, rotating.");
+ log_debug("Journal header limits reached or header out-of-date, rotating.");
server_rotate(s);
server_vacuum(s);
vacuumed = true;
}
if (r == -E2BIG || r == -EFBIG || r == EDQUOT || r == ENOSPC)
- log_info("Allocation limit reached, rotating.");
+ log_debug("Allocation limit reached, rotating.");
else if (r == -EHOSTDOWN)
log_info("Journal file from other machine, rotating.");
else if (r == -EBUSY)
- log_info("Unlcean shutdown, rotating.");
+ log_info("Unclean shutdown, rotating.");
else
log_warning("Journal file corrupted, rotating.");
if (!f)
return;
- log_info("Retrying write.");
+ log_debug("Retrying write.");
}
}
assert(n <= m);
- write_to_journal(s, realuid == 0 ? 0 : loginuid, iovec, n);
+ write_to_journal(s,
+ s->split_mode == SPLIT_NONE ? 0 :
+ (s->split_mode == SPLIT_UID ? realuid :
+ (realuid == 0 ? 0 : loginuid)), iovec, n);
free(pid);
free(uid);
if (!s->system_journal)
return 0;
- log_info("Flushing to /var...");
+ log_debug("Flushing to /var...");
r = sd_id128_get_machine(&machine);
if (r < 0) {
r = journal_file_copy_entry(f, s->system_journal, o, f->current_offset, NULL, NULL, NULL);
if (r == -E2BIG) {
- log_info("Allocation limit reached.");
+ log_debug("Allocation limit reached.");
journal_file_post_change(s->system_journal);
server_rotate(s);
ssize_t n;
if (ev->events != EPOLLIN) {
- log_info("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll.");
return -EIO;
}
int r;
if (ev->events != EPOLLIN) {
- log_info("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll.");
return -EIO;
}
ev->data.fd == s->syslog_fd) {
if (ev->events != EPOLLIN) {
- log_info("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll.");
return -EIO;
}
} else if (ev->data.fd == s->stdout_fd) {
if (ev->events != EPOLLIN) {
- log_info("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll.");
return -EIO;
}
StdoutStream *stream;
if ((ev->events|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) {
- log_info("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll.");
return -EIO;
}