Logging output to be redirected to a particular folder

anuradha.raghupathy2010 at gmail.com anuradha.raghupathy2010 at gmail.com
Tue Nov 6 12:28:05 CET 2012


Below is the python code that I have. I want to redirect the output to my C drive..myapp.log. 

I am editing and creating scripts in IDLE and running it as a python shell or module.

Can you help?

import logging

def main():
   logging.basicConfig(Filename='c://myapp.log', level=logging.ERROR)
   logging.debug('started debug')
   logging.info('info printing')
   logging.warning('test warning')
   logging.debug('debug again')

if __name__ == '__main__':

More information about the Python-list mailing list