I have written a custom handler for an DL model using torch-serve and am trying to understand how to add manual log messages to the handler. I know that I can simply print
any messages and it will show them within the MODEL_LOG
logger at level INFO.
What if I want to add a custom message at DEBUG level or ERROR level? When I try to initialise a logger using
logger = logging.getLogger('model_log')
and add a message within the handler using logger.error
I see the output on screen but at INFO level.
What is the best way to create log messages within a handler at a chosen log-level?