Re: Python Logging: Specifying converter attribute of a log formatter in config file

2012-09-16 Thread Vinay Sajip
On Thursday, August 30, 2012 11:38:27 AM UTC+1, Radha Krishna Srimanthula wrote: > > Now, how do I specify the converter attribute (time.gmtime) in the above > section? Sadly, there is no way of doing this using the configuration file, other than having e.g. a class UTCFormatter(logging.Format

Re: Python Logging: Specifying converter attribute of a log formatter in config file

2012-08-30 Thread bernhard . haslhofer
I have the same problem and couldn't find a solution. It seems that converters can only be set programmatically? On Thursday, August 30, 2012 6:38:27 AM UTC-4, Radha Krishna Srimanthula wrote: > I'd like to have all timestamps in my log file to be UTC timestamp. When > specified through code,

Python Logging: Specifying converter attribute of a log formatter in config file

2012-08-30 Thread srimanthula . radhakrishna
I'd like to have all timestamps in my log file to be UTC timestamp. When specified through code, this is done as follows: myHandler = logging.FileHandler('mylogfile.log', 'a') formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(name)-15s:%(lineno)4s: %(message)-80s') formatter.converter