如何禁用nginx发送消息到系统日志?

我的nginx发送了很多消息到系统日志,但我不需要它们。 在我的nginx.conf中:

error_log /var/log/nginx-error.log notice; ...... server { access_log off; location / { .... } } 

但是,在我看到的/var/log/message

 Nov 22 23:25:09 cache3 nginx: 2011/11/22 23:25:09 [error] 3437#0: *32172530 kevent() reported about an closed connection (60: Operation timed out) while reading response header from upstream, client: , server: , request: "GET http://www.igoido012.com//vk HTTP/1.1", upstream: "http:////vk", host: "www.igoido012.com", referrer: "http://www.baidu.com/" Nov 22 23:25:09 cache3 nginx: 2011/11/22 23:25:09 [error] 3437#0: *32099531 upstream timed out (60: Operation timed out) while reading response header from upstream, client: , server: , request: "GET http://t.web2.qq.com/channel/poll?msg_id=0&clientid=431509&t=1321975433305 HTTP/1.1", upstream: "http://:80/channel/poll?msg_id=0&clientid=431509&t=1321975433305", host: "t.web2.qq.com", referrer: "http://t.web2.qq.com/proxy.html?v=20110331001" 

我怎样才能防止nginx发送消息到我的系统日志?

我不知道nginx会发送到系统日志没有修补:

http://wiki.nginx.org/3rdPartyModules#Third_party_patches

所以,我假设你有一个定制的nginx版本。 看看如何configuration该补丁的补丁源:

https://github.com/yaoweibin/nginx_syslog_patch

如果你正在运行一个简单的nginx,那么别的东西就是把这些日志条目放到syslog中。