Show code
Level Numeric value
=====================
CRITICAL 50
ERROR 40
WARNING 30
INFO 20
DEBUG 10
NOTSET 0September 27, 2021
In this notebook we will learn how to do logging in python. Logging is very important once the project grows beyond a POC stage. Having a logging leads to better debugging, proper error identification, good standard to have. So we’ll going to see how to apply logging through few examples
Logging has differnt configuration, which are important in implementing logging, 1. level 2. formatter 3. Handlers 4. Filters
logging formatter helps formating the message which we write to disk or console. Formatters specify the layout of log records in the final output,
Example, 1. asctime - %(asctime)s 2. created - %(created)f 3. filename - %(filename)s
Handlers send the log records (created by loggers) to the appropriate destination. Filters provide a finer grained facility for determining which log records to output.