Logging output to be redirected to a particular folder

anuradha.raghupathy2010 at gmail.com anuradha.raghupathy2010 at gmail.com
Wed Nov 7 01:39:05 EST 2012


Thanks ...this works perfectly fine now.

On Tuesday, November 6, 2012 11:28:46 PM UTC+5:30, Prasad, Ramit wrote:
> Dennis Lee Bieber wrote:
> 
> > 
> 
> > On Tue, 06 Nov 2012 13:26:11 +0100, Peter Otten <__peter__ at web.de>
> 
> > declaimed the following in gmane.comp.python.general:
> 
> > 
> 
> > > anuradha.raghupathy2010 at gmail.com wrote:
> 
> [snip]
> 
> > > > 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)
> 
> > >
> 
> > 	The double forward slashes might also be confusing... At the least,
> 
> > unneeded...
> 
> > 
> 
> > >>> import os.path
> 
> > >>> print os.path.normpath("c://somefile.log")
> 
> > c:\somefile.log
> 
> > >>> print os.path.normpath("c:\\somefile.log")
> 
> > c:\somefile.log
> 
> > >>> print os.path.normpath("c:\\tryfile.log")
> 
> > c:\tryfile.log
> 
> > >>> print os.path.normpath("c:\tryfile.log")
> 
> > c:	ryfile.log
> 
> > >>> print os.path.normpath("c:/tryfile.log")
> 
> > c:\tryfile.log
> 
> > >>>
> 
> > 
> 
> > 	Doubling back-slashes is needed to avoid the problem of literal
> 
> > escapes corrupting the intent...
> 
> 
> 
> Or use the raw literal form r"c:\tryfile.log". I know several
> 
> people that prefer to use forward slashes as it works in both 
> 
> Windows and *nix.
> 
> 
> 
> 
> 
> ~Ramit
> 
> 
> 
> 
> 
> This email is confidential and subject to important disclaimers and
> 
> conditions including on offers for the purchase or sale of
> 
> securities, accuracy and completeness of information, viruses,
> 
> confidentiality, legal privilege, and legal entity disclaimers,
> 
> available at http://www.jpmorgan.com/pages/disclosures/email.




More information about the Python-list mailing list