chiark / gitweb /
journalctl: add with-unit mode
authorLuca Boccassi <bluca@debian.org>
Tue, 22 May 2018 11:22:00 +0000 (12:22 +0100)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
When dealing with a large number of template instances, for example
when launching daemons per VRF, it is hard for operators to correlate
log lines to arguments.
Add a new with-unit mode which, if available, prefixes unit and user
unit names when displaying its log messages instead of the syslog
identifier. It will also use the full timestamp with timezones, like
the short-full mode.

src/shared/output-mode.c
src/shared/output-mode.h

index 89be1d68a1a17d4bfe9c13ea15549f7ac7076f4a..1bb161794a73f5df783958a9252ef93ec1fa9159 100644 (file)
@@ -21,7 +21,8 @@ static const char *const output_mode_table[_OUTPUT_MODE_MAX] = {
         [OUTPUT_JSON] = "json",
         [OUTPUT_JSON_PRETTY] = "json-pretty",
         [OUTPUT_JSON_SSE] = "json-sse",
-        [OUTPUT_CAT] = "cat"
+        [OUTPUT_CAT] = "cat",
+        [OUTPUT_WITH_UNIT] = "with-unit",
 };
 
 DEFINE_STRING_TABLE_LOOKUP(output_mode, OutputMode);
index 3aa7b295e355676f9d75d44b8191bdd5922b036f..a44d5286756a5336ea8a2fc61a5e30f5707f8eaa 100644 (file)
@@ -23,6 +23,7 @@ typedef enum OutputMode {
         OUTPUT_JSON_PRETTY,
         OUTPUT_JSON_SSE,
         OUTPUT_CAT,
+        OUTPUT_WITH_UNIT,
         _OUTPUT_MODE_MAX,
         _OUTPUT_MODE_INVALID = -1
 } OutputMode;