2009/1/20 Graham Dumpleton <[email protected]>: > See: > > http://code.google.com/p/modwsgi/issues/detail?id=124 > > Use repr() on data being written to convert it into printable ascii. Ie., > > print(repr(s), file=sys.stderr)
Gert, fix for this issue added at 1178 in trunk. Note that there is a still a limitation due to logging via Apache error log functions, namely that a line will be truncated at 8192 characters inclusive of timestamp prefix. The Apache error log functions are used so that messages can be processed correctly by Apache modules which register to see them. Also required where Apache configured to fallback to using syslog for logging. If not using syslog and want logging to go through untouched, then use: import sys sys.__stderr__.write(rawmessage) sys.__stderr__.flush() This will be logged but with not timestamp prefix. A flush is required for data to appear in logs immediately. If no flush done, not guaranteed that message will end up in log file. Graham > Graham > > 2009/1/20 Graham Dumpleton <[email protected]>: >> 2009/1/20 gert <[email protected]>: >>> >>> it was >>> >>> import sys >>> print (s,file=sys.stderr) >>> >>> that did the cutting in the log file, using open did not do any >>> cutting in string mode as in binary mode. >> >> The problem may be that sys.stderr wraps Apache error log functions. >> Those Apache error log functions will only print out stuff up to an >> embedded null character, so potentially can truncate information. Try >> using: >> >> print (repr(s),file=sys.stderr) >> >> It isn't good that information is lost, but not really anything I can >> do about it. I should log a ticket about it though to record caveat. >> What I might be able to do is bypass the Apache log functions and go >> direct to error log file reference which is in Apache server >> structure. >> >> Graham >> > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
