Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a live help on our server that generates an insane amount of access logs as you can imagine. Currently they're appended to all of the other access logs for the site they run on. This makes it difficult to sort through the error logs. Is there a way I can specify that anything within /livehelp go into a different log file?

share|improve this question
up vote 2 down vote accepted
<Directory "/livehelp">
     CustomLog /my/custom/access.log combined
     ErrorLog /my/custom/apache2/error.log
share|improve this answer
Can I put this within a <virtualHost *:80></virtualHost> ? – Webnet Jul 23 '10 at 14:38
if you want to apply this on a virtual host, you should put it into that virtual host configuration. – Ehsan Jul 23 '10 at 14:45
At least on my test here you can't put CustomLog and ErrorLog inside a <Directory> – coredump Jul 23 '10 at 14:48
@coredump - that's the same thing that happened here, it threw an error. – Webnet Jul 23 '10 at 15:03

If you move /livehelp to its own VirtualHost (which requires its own HostName) you can customize the logs to keep them separate. You would use the CustomLog and ErrorLog directives to specify the location for those logs.

<VirtualHost *:80>
        DocumentRoot /path/to/the/livehelp/folder
        ErrorLog logs/livehelp-error_log
        CustomLog logs/livehelp-access_log combined
share|improve this answer

You could use the piped log [1] feature of apache. Create a shell script like



if [ "x$1" == "xlive" ]; then

grep $FLAGS "$PATTERN" > $2

(untested and needs improvement)

now add

CustomLog "|/path/to/script live /var/log/live" combined 


CustomLog "|/path/to/script std /var/log/std" combined 

to the apache config

you can add some more filtering here if you need


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.