Using variables in access_log, error_log

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by smoneyan on March 20, 2013 at 5:11pm

Hi,
I am using nginx 1.1.19. I am using the following configuration for my site.

I don't want to repeat the site name in access_log, error_log, php_log like this

access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log debug;
fastcgi_param PHP_VALUE "error_log=/var/log/php/example.com.error.log";

I am trying this config. But i end up having file names like in my log folder.
$host.error.log.
I know i'm doing something wrong. Could any one of u help me ?

server{
listen 80;
server_name example.com;
root /var/www/example/src;
index index.html index.htm;

#access_log /var/log/nginx/$host.access.log;
#error_log /var/log/nginx/$host.error.log debug;
fastcgi_param PHP_VALUE "error_log=/var/log/php/example.com.error.log";
include denyhost.conf;
include drupal.conf;
}

Thanks,
Subu

Comments

Variables do not work

Posted by perusio on March 21, 2013 at 1:27am

on the error_log directive. This directive is provided by the core HTTP module.

See: http://trac.nginx.org/nginx/ticket/57

As for access logs it should work out of the box.

thanks

Posted by smoneyan on March 22, 2013 at 10:48am

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /