It could be useful to define some rule about log files.
There are 2 main question to define:
1- Log destination (i suggest /var/log/hltd/ )
2- Format:
in my python script i used logging library with this configuration:
logging.basicConfig(filename="/tmp/anelastic.log",
level=logging.INFO,
format='%(levelname)s:%(asctime)s-%(name)s.%(funcName)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
and each class creates is own logger:
def __init__(self):
self.logger = logging.getLogger(self.__class__.__name__)
it will result something like this in the log file (type-date-class-function-message):
INFO:2014-03-19 17:51:44-LumiSectionHandler.processDATFile - *message*
It could be useful to define some rule about log files.
There are 2 main question to define:
1- Log destination (i suggest /var/log/hltd/ )
2- Format:
in my python script i used logging library with this configuration:
and each class creates is own logger:
it will result something like this in the log file (type-date-class-function-message):