简体   繁体   English

将CGI中的错误消息重定向到Apache日志文件

[英]Redirect error messages in CGI to Apache log file

What is the standard way to log error messages in CGI programs. 在CGI程序中记录错误消息的标准方法是什么。 Using cout or printf in a CGI program, which is run by Apache (/var/www/cgi-bin), interrupts the communication while no messages are logged. 在由Apache运行的CGI程序中使用cout或printf(/ var / www / cgi-bin)会在没有记录消息的情况下中断通信。 How an error message can be redirected to Apache log file while it does not interrupt the communication and the execution of the application? 如何在不中断通信和应用程序执行的情况下将错误消息重定向到Apache日志文件?

尝试使用cerr或:

fprintf(stderr, "log messages");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM