Logging output to be redirected to a particular folder

anuradha.raghupathy2010 at gmail.com anuradha.raghupathy2010 at gmail.com
Tue Nov 6 06:28:05 EST 2012


Hi,

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')
   logging.error('Error')

if __name__ == '__main__':
   main()



More information about the Python-list mailing list