Using variables in access_log, error_log

Events happening in the community are now at Drupal community events on www.drupal.org.
smoneyan's picture

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

perusio's picture

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

smoneyan's picture

thanks

Nginx

Group organizers

Group notifications

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