Emilio Gagliardi
07/26/2023, 8:57 PMlogging.yml
handlers:
...other built-in kedro handlers...
debug_file_handler:
class: logging.handlers.RotatingFileHandler
level: DEBUG
formatter: simple
filename: logs/debug.log
maxBytes: 10485760 # 10MB
backupCount: 20
encoding: utf8
delay: True
loggers:
kedro:
level: INFO
kedro_workbench:
level: INFO
DataSets:
level: DEBUG
handlers: [debug_file_handler]
root:
handlers: [rich, info_file_handler, error_file_handler]
in my module I used:
import logging
logger = logging.getLogger('DataSets')
logger.debug(output)
but when I run the pipeline, the contents of output are still written to the console. What am I missing here? thanks kindly!Nok Lam Chan
07/26/2023, 9:01 PMdebug_file_handler
in root
instead.Emilio Gagliardi
07/26/2023, 9:03 PMhandlers: [debug_file_handler]
from my 'DataSets' entry?Nok Lam Chan
07/26/2023, 9:04 PMDataSets:
and append debug_file_handler
to root
Emilio Gagliardi
07/26/2023, 9:11 PMNok Lam Chan
07/26/2023, 9:12 PMEmilio Gagliardi
07/26/2023, 9:13 PMNok Lam Chan
07/26/2023, 9:13 PMkedro_workbench
?Emilio Gagliardi
07/26/2023, 9:13 PMNok Lam Chan
07/26/2023, 9:16 PMkedro_workbench
?kedor_workbench
, kedro.workbench.xxx.yyy
will also shares the same config. But since you hardcoded the name as DataSets
, it shouldn’t be the caeEmilio Gagliardi
07/26/2023, 9:19 PMNok Lam Chan
07/26/2023, 9:27 PM# logging.yml
...
debug_file_handler:
class: logging.handlers.RotatingFileHandler
level: DEBUG
formatter: simple
filename: debug.log
maxBytes: 10485760 # 10MB
backupCount: 20
encoding: utf8
delay: True
loggers:
kedro:
level: INFO
debug_logging:
level: INFO
root:
handlers: [rich, info_file_handler, debug_file_handler]
my_logger = logging.getLogger("DEBUG_ONLY")
my_logger.debug("something")
DataSets
section and it should worklevel: DEBUG
which tells python that you want to see the DEBUG level messageEmilio Gagliardi
07/26/2023, 9:42 PMlogger = logging.getLogger(__name__)
In your example you used, my_logger = logging.getLogger("DEBUG_ONLY")
but there is no 'DEBUG_ONLY' entry in the loggers section.Nok Lam Chan
07/27/2023, 1:51 PM``` debug_file_handler:
class: logging.handlers.RotatingFileHandler
level: DEBUG
formatter: simple
filename: logs/debug.log
maxBytes: 10485760 # 10MB
backupCount: 20
encoding: utf8
delay: True
loggers:
kedro:
level: INFO
kedro_workbench:
level: INFO
root:
handlers: [rich, info_file_handler, error_file_handler]```
Does this config works?
Emilio Gagliardi
07/28/2023, 4:56 AM