Skip to content

Logging

jfuruness edited this page Nov 29, 2020 · 4 revisions

lib_bgp_data

Utils

Logging Description

In utils there is a file called logger.py. In this file there is a config_logging function with inputs as to the section in the config to run from, and the level of the logging. This will configure the logging to the standard out and to a file in /var/log/lib_bgp_data/.

The default logging.INFO and the default database section is bgp.

You can run debug logs with --debug in the command line arguments

logging in certain files/parser (i.e. MRT Parser) is disabled because logging adds heavy overhead to the point of deadlocking for highly parallelizable programs.

For an explanation on how logging works: logging has different levels. If you are below the set logging level, nothing gets recorded. The levels are, in order top to bottom:

    logging.CRITICAL
    logging.ERROR
    logging.WARNING
    logging.INFO
    logging.DEBUG
    logging.NOTSET

Logging Design Choices

  • A catch all error catcher is no longer used, instead if a parser errors the exception is logged
  • logging will deadlock in parallel processes and must be disabled
  • config_logging is designed so that logging can never be configured twice