summaryrefslogtreecommitdiff
path: root/src/journal/journald-stream.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-stream.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-stream.c')
-rw-r--r--src/journal/journald-stream.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index 36fc755260..c46ffe5d45 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -35,6 +35,7 @@
#include "journald-syslog.h"
#include "journald-kmsg.h"
#include "journald-console.h"
+#include "journald-wall.h"
#define STDOUT_STREAMS_MAX 4096
@@ -106,6 +107,9 @@ static int stdout_stream_log(StdoutStream *s, const char *p) {
if (s->forward_to_console || s->server->forward_to_console)
server_forward_console(s->server, priority, s->identifier, p, &s->ucred);
+ if (s->server->forward_to_wall)
+ server_forward_wall(s->server, priority, s->identifier, p, &s->ucred);
+
IOVEC_SET_STRING(iovec[n++], "_TRANSPORT=stdout");
syslog_priority[strlen("PRIORITY=")] = '0' + LOG_PRI(priority);