<p dir="ltr">On 30 Apr 2014 05:56, "Joydeep Bakshi" <<a href="mailto:joydeep.bakshi@netzrezepte.de">joydeep.bakshi@netzrezepte.de</a>> wrote:<br>
><br>
> Hello Maxim,<br>
><br>
> Presently I have configured separate access & error log for each & every nginx vhost.  I wonder if  there is other alternative which can log all vhosts into a common access & error log and later split them according to vhost for easy debugging.</p>

<p dir="ltr">IIRC there are a variety of projects which do this, with differing degrees of completeness, robustness and complexity. Google should help - I don't have any tool names offhand because it's not the early 2000s any more and things have moved on :-) Logstash, Heka and other centralised logging systems are your friend. None of these, however, are part of nginx.</p>

<p dir="ltr">If you need to log to a deterministic, per-vhost filename, you might like to look at using a variable in your access_log declaration. Combined with only specifying it once at the http{} level of your config, this can reduce config complexity at a (slight) runtime cost.</p>

<p dir="ltr">Maxim has already provided the links to the documentation describing how to do this.</p>
<p dir="ltr">HTH, <br>
J</p>
<p dir="ltr">PS I just remembered: AWStats. That's one tool that can do log splitting or reporting - I forget which. I wouldn't use it these days though. Better solutions exist.<br>
</p>