Commented: (MODPYTHON-223) Make sys.stdout/sys.stderr log
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Commented: (MODPYTHON-223) Make sys.stdout/sys.stderr log




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Commented: (MODPYTHON-223) Make sys.stdout/sys.stderr log  
David Fraser (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-11-07 06:12 PM


[ https://issues.apache.org/jira/brow...action_12495043 ]

David Fraser commented on MODPYTHON-223:
----------------------------------------

As a side comment that may be relevant, I've had print statements running un
der mod_python in Apache on Windows failing because the LOCALE is set to the
 C locale and so encoding things can cause issues...

> Make sys.stdout/sys.stderr log properly to Apache error logs.
> --------------------------------------------------------------
>
>                 Key: MODPYTHON-223
>                 URL: https://issues.apache.org/jira/browse/MODPYTHON-223
>             Project: mod_python
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 3.3.1
>            Reporter: Graham Dumpleton
>
> When sys.stderr or sys.stdout are written to directly, or when the 'print' stateme
nt is used without a target file object, any text output will make it into the Apach
e error log files, but it will only get there after a flush has been performed on st
dou
t/stderr. Most of the time the streams will only be flushed when Apache is b
eing shutdown with the result being that the output is far removed in the lo
g file from any other messages that may have been logged at the same time us
ing the normal Apache error
logging functions. Further, anything output via stdout/stderr does not have associated with 
it the error log prefix giving the time the output was generated.
> All this can be improved by replacing sys.stderr and sys.stdout with custom Python
 objects which buffer any output and flushing it through to the Apache error log usi
ng the proper ap_log_error() function after each newline is encountered. This will m
ean
that output appears straight away as soon as newline sent and output will be prefixed with d
ate/time string.
> Do note though that the output cannot be associated with a specific virtual host a
nd thus would go to the main Apache error log file even if each virtual host has its
 own log file. This is the same as now though when sys.stderr and sys.stdout are use
d.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:31 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register