summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-02-13 19:23:44 +0100
committerThomas Haller <thaller@redhat.com>2016-02-16 14:37:50 +0100
commit8d385869d9cc9460a62d59f2ff363ee8086b457d (patch)
tree5cf549ec9453ceea0de39ae7ef1cd7ff3e210026
parentf20a597b68d6da073d86e7f3fef47ab9d478f652 (diff)
downloadNetworkManager-th/logging-format-bgo762009.tar.gz
logging: always print the timestamp and align locationth/logging-format-bgo762009
Change the logging format. For syslog, we will now always print the timestamp (also for <info> and <warn> messages). Also, when printing the file location, we will always align it. For journal logging, also enable the timestamp. While the timestamp is already captured separately by journal, most of the time a user will look at the syslog like output from journal, so we want the timestamps there too.
-rw-r--r--src/nm-logging.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nm-logging.c b/src/nm-logging.c
index 61a847bf95..12cffaffbd 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -66,10 +66,10 @@ typedef enum {
_LOG_FORMAT_FLAG_LEVEL_SEVERE = LOG_FORMAT_FLAG_TIMESTAMP_SEVERE |
LOG_FORMAT_FLAG_LOCATION_SEVERE,
- _LOG_FORMAT_FLAG_SYSLOG = LOG_FORMAT_FLAG_TIMESTAMP_DEBUG |
- LOG_FORMAT_FLAG_TIMESTAMP_SEVERE |
+ _LOG_FORMAT_FLAG_SYSLOG = _LOG_FORMAT_FLAG_TIMESTAMP |
LOG_FORMAT_FLAG_LOCATION_DEBUG |
- LOG_FORMAT_FLAG_LOCATION_SEVERE,
+ LOG_FORMAT_FLAG_LOCATION_SEVERE |
+ LOG_FORMAT_FLAG_ALIGN_LOCATION,
} LogFormatFlags;
static void
@@ -754,7 +754,7 @@ nm_logging_syslog_openlog (const char *logging_backend)
if (strcmp (logging_backend, "journal-syslog-style") == 0)
log_format_flags = _LOG_FORMAT_FLAG_SYSLOG;
else
- log_format_flags = LOG_FORMAT_FLAG_NONE;
+ log_format_flags = _LOG_FORMAT_FLAG_TIMESTAMP;
global.log_backend = LOG_BACKEND_JOURNAL;
/* ensure we read a monotonic timestamp. Reading the timestamp the first