Jump to content

Dynamic Log Filename in httpd.conf


komodo9

Recommended Posts

Hi,

 

I run a cluster of 6 apache servers that share a common httpd.conf (through nfs).  The problem I'm facing is with the log files.

 

I do not want each server to store the log file on their own hard drives because of space restrictions, and I instead require the log files to be on the NFS mount (located at /array/).

 

All six servers are writing to the log files at the same time, causing spliced lines and nearly unreadable output.  My question is regarding this line:

 

    CustomLog /array/log/httpd-access.log combined

 

Is there any way to save the log file to a dynamic path, such as:

 

    CustomLog /array/log/__$LOCAL_HOST_NAME$__/httpd-access.log

 

Or even better, does anyone have any ideas on how to keep a single log file for all servers, without splicing and mutilating the output, and without slowing down each server, waiting for locks on the file to release?

 

I look forward to your help.  Thanks in advance.  :)

Link to comment
https://forums.phpfreaks.com/topic/128059-dynamic-log-filename-in-httpdconf/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.