summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-08-24 22:21:20 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-03 18:59:04 -0700
commit877d54e9b09e093c2102f519a84e2a52637ae035 (patch)
treeff7926d33cd29b9e2930cb401a7be412c7724241 /src/timedate
parent88fae6e0441d4195e089434f07d3e7fd811d6297 (diff)
journal: generate structured journal messages for a number of events
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedated.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 09fd808332..34d287b2a1 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -25,6 +25,8 @@
#include <string.h>
#include <unistd.h>
+#include "systemd/sd-id128.h"
+#include "systemd/sd-messages.h"
#include "util.h"
#include "strv.h"
#include "dbus-common.h"
@@ -701,7 +703,11 @@ static DBusHandlerResult timedate_message_handler(
hwclock_set_time(tm);
}
- log_info("Changed timezone to '%s'.", tz.zone);
+ log_struct(LOG_INFO,
+ "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_TIMEZONE_CHANGE),
+ "TIMEZONE=%s", tz.zone,
+ "MESSAGE=Changed timezone to '%s'.", tz.zone,
+ NULL);
changed = bus_properties_changed_new(
"/org/freedesktop/timedate1",
@@ -842,7 +848,11 @@ static DBusHandlerResult timedate_message_handler(
hwclock_set_time(tm);
- log_info("Changed local time to %s", ctime(&ts.tv_sec));
+ log_struct(LOG_INFO,
+ "MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(SD_MESSAGE_TIME_CHANGE),
+ "REALTIME=%llu", (unsigned long long) timespec_load(&ts),
+ "MESSAGE=Changed local time to %s", ctime(&ts.tv_sec),
+ NULL);
}
} else if (dbus_message_is_method_call(message, "org.freedesktop.timedate1", "SetNTP")) {
dbus_bool_t ntp;