summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGergely Nagy <algernon@madhouse-project.org>2012-03-20 08:02:52 +0100
committerGergely Nagy <algernon@madhouse-project.org>2012-03-20 08:02:52 +0100
commitf1aa83229b7d2e551ac2f7e8a4cf5dcc5b3b58ca (patch)
treef3bfbc564aa22a5f012da8eeb0e2e94bdd6a825a /lib
parent6627c0249ed53580a173e7b0190937c14fc2d2cd (diff)
downloadlibumberlog-f1aa83229b7d2e551ac2f7e8a4cf5dcc5b3b58ca.tar.gz
libumberlog-f1aa83229b7d2e551ac2f7e8a4cf5dcc5b3b58ca.tar.xz
libumberlog-f1aa83229b7d2e551ac2f7e8a4cf5dcc5b3b58ca.zip
Add the identity to the automatically added fields.
The identity, as set by the first argument to openlog() can be cached away, and later used as the program name (that's pretty much how syslogds treat it, too), so add it to the list of automatically discovered fields. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/cee-syslog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/cee-syslog.c b/lib/cee-syslog.c
index 3c6e3ca..60d8517 100644
--- a/lib/cee-syslog.c
+++ b/lib/cee-syslog.c
@@ -53,6 +53,7 @@ static __thread struct
int facility;
pid_t pid;
+ const char *ident;
} cee_sys_settings;
static void
@@ -71,6 +72,7 @@ cee_openlog (const char *ident, int option, int facility)
cee_sys_settings.flags = option;
cee_sys_settings.facility = facility;
cee_sys_settings.pid = getpid ();
+ cee_sys_settings.ident = ident;
}
/** HELPERS **/
@@ -150,6 +152,7 @@ _cee_discover (struct json_object *jo, int priority)
"pid", "%d", _find_pid (),
"facility", "%s", _find_facility (),
"priority", "%s", _find_prio (priority),
+ "program", "%s", cee_sys_settings.ident,
NULL);
}