peter
07/20/2023, 5:15 PMlogging.yml
a callable formatter that has been defined in a local python file?
I'm not succeeding in doing so and have tried several different paths for the custom formatter. E.g i have a callable factory
defined in a file config_loader.py
which is in the same dir as the `logging.yml`:
version: 1
disable_existing_loggers: false
formatters:
default:
format: "%(message)s"
custom:
(): .config_loader.factory
handlers:
console:
class: logging.StreamHandler
level: INFO
formatter: custom
stream: "<ext://sys.stderr>"
root:
level: INFO
propagate: yes
handlers: [console]
edgar_ramirez_mondragon
07/20/2023, 7:35 PMThis is signalled by an absolute import path to the factory being made available under the special keyThat means relative imports are not supported:.'()'
formatters:
default:
format: "%(message)s"
custom:
(): config_loader.factory
Also, you have to make your module available to the Python interpreter. You can do that with the PYTHONPATH
variable. If config_loader.py
and logging.yml
are at the project root:
PYTYHONPATH=. meltano ...