...
Technical Approach
- Most fields from Jakarta Best Practice Proposal for Standardized Logging Fields - v2 - Developer Wiki - Confluence (onap.org) page can be configured using Python logging standard library (some
- Some fields are already defined logging — Logging facility for Python — Python 3.10.7 documentation)
- The rest is to create a proper configuration that could be reused by all projects (the question is if that should be done by some package or kept in one place in wiki or something).
- Configuration could be a part of the ONAP Python base image and developers can only load it from a file stored on the container, that which is explained there (Logging HOWTO — Python 3.10.7 documentation).
- That would be the easiest part but… we are going to have some custom fields on record so looks like we have to define our own logging — (Logging facility for Python — Python 3.10.7 documentation) LogRecord class.
- So probably the best way is to create a package with that and install it on all base containers, so developers could import it. But maybe others has some ideas.
- https://docs.python.org/3.10/howto/logging.html#configuring-logging
- https://docs.python.org/3/library/logging.html#logrecord-attributes
ONAP Related Resources