-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02.py
More file actions
11 lines (10 loc) · 714 Bytes
/
02.py
File metadata and controls
11 lines (10 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
import logging
a="veribule"
LOG_FORMAT = "%(user)s[%(ip)s] - %(levelname)s***%(name)s******%(message)s***%(asctime)s"
DATE_FORMAT = "%Y-%m-%d %I:%M:%S %P"
logging.basicConfig(datefmt = DATE_FORMAT,format=LOG_FORMAT,level=logging.DEBUG,filemode='w',filename="/home/tlxy/dana/tutu.txt")
logging.debug("This is debug DE {}".format(a), exc_info=True,extra={'user':'tom','ip':'47.98.53.222'})
logging.info("This is info",extra={'user':'tom','ip':'47.98.53.222'})
logging.log(logging.WARNING,'This is warning',extra={'user':'tom','ip':'47.98.53.222'})
logging.error('this is a error',extra={'user':'tom','ip':'47.98.53.222'})
logging.log(logging.CRITICAL, "This is a Critical",extra={'user':'tom','ip':'47.98.53.222'})