Logging
Check This First!
This article refers to BaseModel accessed via Docker container. Please refer to Snowflake Native App section if you are using BaseModel as SF GUI application.
By default, logs are streamed to the console on the INFO level, however, you can define custom configuration in a separate file and set the path to it in LOGGING_CONFIG_PATH
environmental variable. The overall structure of configuration file should follow the format for Python logging modules described in Configuration dictionary schema.
The example below shows the content of the file that defines logs streaming to console, main.log
file, and error.log
file.
Example |
---|
version: 1
formatters:
default:
format: '%(asctime)s - %(levelname)8s - %(name)s: %(message)s'
datefmt: '%Y-%m-%d %H:%M:%S'
handlers:
console:
class: logging.StreamHandler
level: INFO
formatter: default
stream: ext://sys.stdout
mainFile:
class: logging.FileHandler
level: INFO
formatter: default
filename: logs/main.log
mode: a
errorFile:
class: logging.FileHandler
level: ERROR
formatter: default
filename: logs/error.log
mode: a
loggers:
monad:
level: INFO
handlers: [console, mainFile, errorFile]
propagate: False
root:
level: WARNING
handlers: []
Updated 2 days ago