Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

  • logger=azeti_file
  • by default should be level=INFO
  • TimedRotatingFileHandlerSizeRotatingFileHandler
    • rotation daily by midnight and 7 after 10490000 Bytes and 5 backup-files configure

other useful handlers:

Info

Have a look into the official docs to find examples for file size based rotation.


Info
titleChanging the size rotation parameters

The default for the file size dependent parameters in the SiteController.cfg is

Code Block
languagebash
[handler_SizeRotatingFileHandler]
# Size based rotation of log files
formatter = simpleFormatter
class = handlers.RotatingFileHandler
# Rotate if a file exceeds 1049000 bytes (1 MiB) and keep 5 old files
args = (['%(logfilename)s', 'a', 10490000, 5])

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

Code Block
languagebash
[handler_SizeRotatingFileHandler]
# Rotate if a file exceeds 1049000 bytes (1 MiB) and keep 15 old files
args=(['%(logfilename)s', 'a', 10490000, 15])



Levels

LevelNumeric valueIntended purpose
CRITICAL50Used to log events so grave it causes the process not being able to continue running (e.g. a not specificially handled runtime error).
ERROR40Used 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)
WARNING30Used 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)
INFO20

Used to log seldom (!) informative events like starting and stopping of processes or configuration changes.
Note: INFO should never log more than a few lines a day. That means if INFO log messages on SC in regular operation exceeds 1kiB / day, then there are too many INFO messages, move the most unimportant ones to DEBUG instead

DEBUG10Used to log anything else, especially any detailled log messages to debug a certain condition.
NOTSET0This 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).

...