Tabulated log file format with the python logging system
        Posted  
        
            by yorjo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by yorjo
        
        
        
        Published on 2010-05-05T22:17:05Z
        Indexed on 
            2010/05/05
            23:18 UTC
        
        
        Read the original article
        Hit count: 255
        
Hi everybody,
I'm using the python logging module with the "native" configuration file support (config.fileconfig) as describe in the documentation here :
http://docs.python.org/library/logging.html (see the logging.conf file)
I was wondering if it's possible to supply a tabulated data format in the configuration file?
The sample configuration file is the following:
[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
I though that using the \t in the format would be enough but it doesn't.
format=%(asctime)s\t%(name)s\t%(levelname)s\t%(message)s\t  
If I do so it print \t in the result. I tried a couple of thing without success. I suppose it's really easy to do but I don't find it!
How can I do that?
© Stack Overflow or respective owner