Error log

I setup error and access logs as

access_log /logs/access/$server_name.access.log main;
error_log /logs/error/$server_name.error.log info;

access logs are created correctly for each virtual host, but for
error_log “$server_name” is not transformed to the server name, and one
error log named “$server_name.error.log” is created.

Posted at Nginx Forum:

On Thu, Jun 09, 2011 at 07:00:32AM -0400, etrader wrote:

I setup error and access logs as

access_log /logs/access/$server_name.access.log main;
error_log /logs/error/$server_name.error.log info;

access logs are created correctly for each virtual host, but for
error_log “$server_name” is not transformed to the server name, and one
error log named “$server_name.error.log” is created.

nginx does not currently support variables in error_log name.


Igor S.