Teil 27: logging.config
This commit is contained in:
37
teil27/halloween_log_conf.json
Normal file
37
teil27/halloween_log_conf.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"version":1,
|
||||
"filters": {
|
||||
"halloween":{
|
||||
"()": "__main__.HalloweenFilter"
|
||||
}
|
||||
},
|
||||
"formatters":{
|
||||
"std_out":{
|
||||
"format": "%(asctime)s : %(levelname)s : %(lineno)d : %(message)s",
|
||||
"datefmt":"%I:%M:%S %d.%m.%Y"
|
||||
},
|
||||
"json": {
|
||||
"()": "__main__.JsonFormatter"
|
||||
}
|
||||
},
|
||||
"handlers":{
|
||||
"console":{
|
||||
"formatter": "std_out",
|
||||
"class": "logging.StreamHandler",
|
||||
"level": "DEBUG"
|
||||
},
|
||||
"file":{
|
||||
"formatter":"json",
|
||||
"class":"logging.FileHandler",
|
||||
"level":"DEBUG",
|
||||
"filename" : "halloween.log",
|
||||
"filters": ["halloween"]
|
||||
}
|
||||
},
|
||||
"root":{
|
||||
"handlers":["console","file"],
|
||||
"level": "DEBUG"
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user