# Using server\_name variable in error\_log filename

**URL:** <https://www.ruby-forum.com/t/using-server-name-variable-in-error-log-filename/193744>\
**Category:** NGINX\
**Created:** [August 23, 2010, 9:29pm UTC](https://www.ruby-forum.com/t/using-server-name-variable-in-error-log-filename/193744 "2010-08-23T21:29:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ondrej\_Jombik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/a698b9/32.png) [@Ondrej\_Jombik](https://www.ruby-forum.com/u/Ondrej_Jombik)\
**Post date:** [August 23, 2010, 9:29pm UTC](https://www.ruby-forum.com/t/using-server-name-variable-in-error-log-filename/193744/1 "2010-08-23T21:29:58Z")

</div>

This is good way how to make separate error logging per-server section

> **[Separating Error Logs per Virtual Host | NGINX](https://www.nginx.com/resources/wiki/start/topics/examples/separateerrorloggingpervirtualhost/)**
>
> An example NGINX configuration that keeps a separate error log for each server block.

However we have many shared configuration files in conf.d/ and we have  
one especially dedicated to logging.

Is there any variable containing server\_name (and port) value which can  
be use in filename passed to error\_log ?

Thanks

Ondrej

–  
Ondrej JOMBIK  
Platon Technologies Ltd., Hlavna 3, Sala SK-92701  
+421 903 PLATON - removed\_email\_address@domain.invalid - [http://platon.org](http://platon.org)
