Which log are you looking in. Use of printf() at C level would only go to main Apache error log and never to a virtual host error log.
Graham On 4 December 2012 17:46, Linux Omicron <[email protected]> wrote: > Thanks for reply Graham. > I did try with fflush() in the c library code but no change in output. The > log file shows only python print statement but c printf() have been > discarded. > > Thanks, > Linux Omicron. > > On Tuesday, October 2, 2012 3:17:42 PM UTC+9, Graham Dumpleton wrote: > >> On 23 September 2012 21:27, Linux Omicron <[email protected]> wrote: >> > Hello Everyone, >> > >> > I am developing a web application using pylons pyramid. I am not using >> > default web server waitress but relying on mod_wsgi. >> > My pyramid application internally uses a c library. In the c library, >> some >> > places,printf() statement is used for debug logs. >> > When I run my pyramid application under mode_wsgi, I observed that >> debug >> > information was being logged in application log file for python print >> > statements but none of the printf() were logged. >> > Don't print and printf() have same function to print on stdout? >> > How do I enable logging using printf() statement? >> >> The issue in this case is going to be how Apache attaches C >> stdout/stderr to the Apache error log. The way it is done means it is >> effectively buffered. This means that if there is no explicit fflush() >> done in the C code to force writing out the messages to the Apache >> error log, they will only get flushed when the buffer fills up, or if >> you are lucky when the process exits and stdout/stderr are >> automatically flushed on closure. >> >> Also be aware that being C level stdio/stderr I/O operations, when the >> messages appear in the Apache error log they will not be prefixed with >> any timestamp information. >> >> Graham >> > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/modwsgi/-/Z9LGyalT0EwJ. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
