summaryrefslogtreecommitdiff
path: root/src/journal/journald-server.c
diff options
context:
space:
mode:
authorSebastian Thorarensen <sebth@naju.se>2014-03-14 00:38:15 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-14 22:05:25 +0100
commit40b71e89bae4e51768db4dc50ec64c1e9c96eec4 (patch)
tree39de34bcee5d996a8e98ef792fc7201276b0cf63 /src/journal/journald-server.c
parent9003d9b0d628be059922e522fd35f9c5b4d8b039 (diff)
journald: add support for wall forwarding
This will let journald forward logs as messages sent to all logged in users (like wall). Two options are added: * ForwardToWall (default yes) * MaxLevelWall (default emerg) 'ForwardToWall' is overridable by kernel command line option 'systemd.journald.forward_to_wall'. This is used to emulate the traditional syslogd behaviour of sending emergency messages to all logged in users.
Diffstat (limited to 'src/journal/journald-server.c')
-rw-r--r--src/journal/journald-server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 8680650759..f0117e742e 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1319,6 +1319,12 @@ static int server_parse_proc_cmdline(Server *s) {
log_warning("Failed to parse forward to console switch %s. Ignoring.", word + 36);
else
s->forward_to_console = r;
+ } else if (startswith(word, "systemd.journald.forward_to_wall=")) {
+ r = parse_boolean(word + 33);
+ if (r < 0)
+ log_warning("Failed to parse forward to wall switch %s. Ignoring.", word + 33);
+ else
+ s->forward_to_wall = r;
} else if (startswith(word, "systemd.journald"))
log_warning("Invalid systemd.journald parameter. Ignoring.");
}
@@ -1466,11 +1472,13 @@ int server_init(Server *s) {
s->rate_limit_burst = DEFAULT_RATE_LIMIT_BURST;
s->forward_to_syslog = true;
+ s->forward_to_wall = true;
s->max_level_store = LOG_DEBUG;
s->max_level_syslog = LOG_DEBUG;
s->max_level_kmsg = LOG_NOTICE;
s->max_level_console = LOG_INFO;
+ s->max_level_wall = LOG_EMERG;
memset(&s->system_metrics, 0xFF, sizeof(s->system_metrics));
memset(&s->runtime_metrics, 0xFF, sizeof(s->runtime_metrics));