Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32815
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Subject | Re: Logging output to be redirected to a particular folder |
| Date | 2012-11-06 13:26 +0100 |
| Organization | None |
| References | <bdec816f-bde8-427a-b604-30e12a773595@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3318.1352204779.27098.python-list@python.org> (permalink) |
anuradha.raghupathy2010@gmail.com wrote:
> 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)
Python is case-sensitive. Try:
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()
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Logging output to be redirected to a particular folder anuradha.raghupathy2010@gmail.com - 2012-11-06 03:28 -0800
Re: Logging output to be redirected to a particular folder Peter Otten <__peter__@web.de> - 2012-11-06 13:26 +0100
Re: Logging output to be redirected to a particular folder Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-06 12:38 -0500
RE: Logging output to be redirected to a particular folder "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-06 17:58 +0000
Re: Logging output to be redirected to a particular folder anuradha.raghupathy2010@gmail.com - 2012-11-06 22:39 -0800
Re: Logging output to be redirected to a particular folder anuradha.raghupathy2010@gmail.com - 2012-11-06 22:39 -0800
csiph-web