On Sat, Jan 17, 2009 at 05:11:32PM +0100, Sen Haerens wrote:
How can I use global traffic log and custom access log together?
There is no “global” logs in nginx, only “local” ones, either
explicitly defined or inhereted from previous level.
The access_log directive, as all array-type directives in nginx
config, will ignore inherited values if defined at certain level.
I.e. in configuration
http {
access_log log1;
server {
server_name server1;
}
server {
server_name server2;
access_log log2;
...
}
}
only server1 will have logging set to log1, while server2 will
have logging set to log2. If you want server2 to write log into
both log1 and log2 you should say this explicitly, i.e.
server {
server_name server2;
access_log log1;
access_log log2;
...
}