pip_services3_components.log.CachedLogger module


Cached logger implementation


Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.


MIT, see LICENSE for more details.

class pip_services3_components.log.CachedLogger.CachedLogger

Bases: pip_services3_components.log.Logger.Logger, pip_services3_commons.config.IReconfigurable.IReconfigurable

Abstract logger that caches captured log messages in memory and periodically dumps them. Child classes implement saving cached messages to their specified destinations.

### Configuration parameters ###
  • level: maximum log level to capture

  • source: source (context) name

  • options:
    • interval: interval in milliseconds to save log messages (default: 10 seconds)

    • max_cache_size: maximum number of messages stored in this cache (default: 100)

### References ###
  • *:context-info:*:*:1.0 (optional) ContextInfo to detect the context id and specify counters source


Clears (removes) all cached log messages.

configure(config: pip_services3_commons.config.ConfigParams.ConfigParams)

Configures component by passing configuration parameters.


config – configuration parameters to be set.


Dumps (writes) the currently cached log messages.