Link Python system error stream into a file : Standard Redirect : Development PYTHON examples


PYTHON examples » Development » Standard Redirect »

 

Link Python system error stream into a file




import sys

fsock = open('error.log', 'w')
sys.stderr = fsock
raise Exception, 'this error will be logged'

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Development
» Standard Redirect