======= Logging ======= .. _logging: https://docs.python.org/3/library/logging.html ActiveLogic Python API uses Python's built-in `logging`_ module to perform system logging. The usage of this module is discussed in detail in Python's own documentation. Loggers ======= ActiveLogic Python API provides several built-in loggers. activelogic --------------- The catch-all logger for messages in ActiveLogic Python API. Log messages are posted using any of the loggers below rather than this name. activelogic.pldb.* ---------------------- Log messages related to the physical connection and the pldb side of things. activelogic.asyncapi.* ------------------------ Resource-specific log messages. Configuring Logging =================== .. _fileConfig(): https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig .. _dictConfig(): https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig Programmers can configure logging in three ways: 1. Creating loggers, handlers and formatters explicitly using Python code. 2. Creating a logging config file and reading it using `fileConfig()`_. 3. Creating a dictionary of log configuration and pass it to `dictConfig()`_. The following example configures a very simple logger, a console handler, and a simple formatter using Python code: .. literalinclude:: examples/logging/simple.py Here's an example of the same setup using the **dictConfig** format: .. literalinclude:: examples/logging/settings.py