Skip to content

Commit 8eaf414

Browse files
committed
Enhance logging format for better readability
Added timestamp with milliseconds, log level, and custom date format to improve clarity and make logs more useful for debugging. Change-Id: Ice2d601eddb54bbb0e7e3be6f03ba6db58256c1f
1 parent ee7fe59 commit 8eaf414

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docker/base/set_configs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626

2727

2828
# TODO(rhallisey): add docstring.
29-
logging.basicConfig()
29+
logging.basicConfig(
30+
format='%(asctime)s.%(msecs)03d %(levelname)s %(message)s',
31+
level=logging.INFO,
32+
datefmt='%Y-%m-%d %H:%M:%S'
33+
)
3034
LOG = logging.getLogger(__name__)
3135
LOG.setLevel(logging.INFO)
3236

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
features:
3+
- |
4+
Improves logging format of kolla containers by adding
5+
timestamps with milliseconds, log levels, and a custom
6+
date format.
7+
upgrade:
8+
- |
9+
Users who parse Docker container logs should take into account
10+
that for example `INFO:__main__:Validating config file` is now
11+
`YYYY-MM-DD HH:MM:SS.fff INFO Validating config file`.

0 commit comments

Comments
 (0)