summaryrefslogtreecommitdiff
path: root/cloudinit/log.py
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2017-10-06 13:22:54 -0600
committerChad Smith <chad.smith@canonical.com>2017-10-06 13:22:54 -0600
commit9fd022780ae516df3499b17b2d69b72fc502917c (patch)
treebc33ac6296f374414ccb15dce233a4293b8633d3 /cloudinit/log.py
parent89630a6658c099d59f2766493a35c2ad266a8f42 (diff)
parent45d361cb0b7f5e4e7d79522bd285871898358623 (diff)
downloadvyos-cloud-init-9fd022780ae516df3499b17b2d69b72fc502917c.tar.gz
vyos-cloud-init-9fd022780ae516df3499b17b2d69b72fc502917c.zip
merge from master at 17.1-17-g45d361cb
Diffstat (limited to 'cloudinit/log.py')
-rw-r--r--cloudinit/log.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 3861709e..1d75c9ff 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -19,6 +19,8 @@ import sys
import six
from six import StringIO
+import time
+
# Logging levels for easy access
CRITICAL = logging.CRITICAL
FATAL = logging.FATAL
@@ -32,6 +34,9 @@ NOTSET = logging.NOTSET
# Default basic format
DEF_CON_FORMAT = '%(asctime)s - %(filename)s[%(levelname)s]: %(message)s'
+# Always format logging timestamps as UTC time
+logging.Formatter.converter = time.gmtime
+
def setupBasicLogging(level=DEBUG):
root = logging.getLogger()