pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

Ability to disable automatic logger config

Open mLewisLogic opened this issue 7 years ago • 0 comments

  • pulsar version: 2.0.2
  • python version: 3.6.5
  • platform: MacOS/CentOS

Description

I'm attempting to use Pulsar to rewire a legacy synchronous system in the actor style. I have pre-existing logging configurations that I would prefer to use (multiple file handlers for different subpackages/modules).

I tried setting cfg.set('log_handlers', logging._handlerList), but that fails when it runs dictConfig in log.configuredLogger because I've already called dictConfig prior to setting up the Pulsar arbiter. ValueError: Unable to configure root logger: Unable to add handler <weakref at 0x10c892408; to 'FileHandler' at 0x10c89eac8>

Even that was a bit of a shot in the dark. I couldn't find a clear way to disable the logging autoconfig and control the config myself.

Expected behaviour

Ability to use Pulsar as a library which allows me to define my own logging config.

Actual behaviour

Pulsar configures logging itself, overriding logging config that I have setup.

Steps to reproduce

  1. Setup logging using dictConfig.
  2. Initialize an arbiter.
  3. Original logging config is overwritten when self.cfg.configured_logger is called in Concurrency.get_event_loop()

mLewisLogic avatar Apr 29 '18 07:04 mLewisLogic