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
This commit is contained in:
Michal Arbet 2024-09-21 22:07:22 +02:00
parent ee7fe59f7b
commit 8eaf4149b1
2 changed files with 16 additions and 1 deletions

View File

@ -26,7 +26,11 @@ import sys
# TODO(rhallisey): add docstring. # TODO(rhallisey): add docstring.
logging.basicConfig() logging.basicConfig(
format='%(asctime)s.%(msecs)03d %(levelname)s %(message)s',
level=logging.INFO,
datefmt='%Y-%m-%d %H:%M:%S'
)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
LOG.setLevel(logging.INFO) LOG.setLevel(logging.INFO)

View File

@ -0,0 +1,11 @@
---
features:
- |
Improves logging format of kolla containers by adding
timestamps with milliseconds, log levels, and a custom
date format.
upgrade:
- |
Users who parse Docker container logs should take into account
that for example `INFO:__main__:Validating config file` is now
`YYYY-MM-DD HH:MM:SS.fff INFO Validating config file`.