|
azeti_logging.py
SiteController.cfg
(formerly in azeti_logging.cfg
)level=INFO
Rotating by filesize: https://docs.python.org/3/library/logging.handlers.html#logging.handlers.RotatingFileHandler
Have a look into the official docs to find examples for file size based rotation. |
The default for the file size dependent parameters in the SiteController.cfg is
There is no need to have default parameters present in a SiteController.cfg file. Default values are used when there is no entry in the SiteController.cfg To change the count of old backup files per logfilename from default (5) to 15 add following snippet to the specific SiteController.cfg
|
Level | Numeric value | Intended purpose |
---|---|---|
CRITICAL | 50 | Used to log events so grave it causes the process not being able to continue running (e.g. a not specificially handled runtime error). |
ERROR | 40 | Used to log events which indicate an erroneous condition but the process can continue its processing by ignoring the fact (e.g. ignoring a contradictory configuration entry) |
WARNING | 30 | Used to log events which indicate erroneous or probably unwanted conditions and the process takes workaround measures to continue processing (e.g. a missing file and the process uses default values instead) |
INFO | 20 | Used to log seldom (!) informative events like starting and stopping of processes or configuration changes. |
DEBUG | 10 | Used to log anything else, especially any detailled log messages to debug a certain condition. |
NOTSET | 0 | This is not a real log level but causes the logger to determine the actual log level by looking somewhere else (refer to the Python documentation). |
No log level (with the only exception of Debug level) is allowed to log messages periodically!
Example:
Every module should log when it starts and when it finishes with a common structure (meaning we decide a sentence like "Module ... starting".
Examples:
A circumstance that is not expected but something that will not affect the functionality itself but the result may not what the user is expecting or is likely just a temporary thing.
Examples:
Any circumstance that is not expected, affect the proper functioning of the module, and may lead to the user receiving wrong information or a false perception about something working. The system is not able to resolve on its own. The module itself is not able to continue checking that particular part, however anything else in the module is not affected and the module continues to check anything else.
Examples:
Is an error where the module is not able to recover and unrelated checks are to be expected to be affected, too. This might lead to information loss.
Examples:
Information that the developer consider necessary to debug the module, meaning in this mode we show as much information as it is required to show what is exactly happening at every point.
|