How to set different levels for different python log handlers

后端 未结 4 803
南方客
南方客 2020-12-12 17:56

I\'ve read a few posts on this but I\'m still confused. I have this logging setup:

import logging

class MongoHandler(logging.Handler):
    def __init__(sel         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-12 18:33

    An addition to GrantVS's answer:

    I had to use

    logging.basicConfig(level=logging.DEBUG)
    

    in order for it to work. Otherwise great answer, thanks!

    Mario

    PS: For some reason the system doesn't let me comment GrantVS's answer directly.

提交回复
热议问题