Nginx logging with huge vhosts

Hello,

How to log both access & error efficiently with nginx having huge vhost
?
Is there any CustomLog available to collect the combined_vhost
information ?

Is it good configuring separate access & error logs when huge vhost ?

Please suggest.

Thanks

Hello!

On Tue, Apr 29, 2014 at 04:22:45PM +0530, Joydeep Bakshi wrote:

Hello,

How to log both access & error efficiently with nginx having huge vhost ?
Is there any CustomLog available to collect the combined_vhost information ?

Is it good configuring separate access & error logs when huge vhost ?

Sorry, I’ve failed to understand your questions.
On the other hand, most likely there are answers in the
documentation, see here:

http://nginx.org/r/error_log
http://nginx.org/r/access_log
http://nginx.org/r/log_format


Maxim D.
http://nginx.org/

Hello Maxim,

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.

Thanks

On 30 Apr 2014 05:56, “Joydeep Bakshi” [email protected]
wrote:

Hello Maxim,

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.

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 :slight_smile: Logstash, Heka and other centralised logging
systems are your friend. None of these, however, are part of nginx.

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.

Maxim has already provided the links to the documentation describing how
to
do this.

HTH,
J

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs