Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

Apache 2.4 - rotatelogs.exe in VirtualHost

Post new topic   Reply to topic    Apache Forum Index -> Apache

View previous topic :: View next topic  
Author Message

Joined: 30 Aug 2018
Posts: 2
Location: Switzerland, Berne

PostPosted: Mon 03 Sep '18 22:19    Post subject: Apache 2.4 - rotatelogs.exe in VirtualHost Reply with quote

I wonder if it is possible to use variables for path and name of the logfiles.

<VirtualHost *:80>
  ServerName localhost
  CustomLog "|bin/rotatelogs.exe D:/logs/localhost-%Y-%m-%d.log 86400" combined
  DocumentRoot "${DOCROOT}"

Now I would like to do something like this:

Define LOGROOT "D:/WWW/Logs"

<VirtualHost *:80>
  ServerName localhost
  CustomLog "|bin/rotatelogs.exe ${LOGROOT}/%HTTP_HOST%-%Y-%m-%d.log 86400" combined
  DocumentRoot "${DOCROOT}"

I'm not sure, if there is a way to do this. At least the path for log files as variable would allow simple changes when moving all to the production server.

Back to top
James Blond

Joined: 19 Jan 2006
Posts: 6597
Location: Germany, Next to Hamburg

PostPosted: Wed 05 Sep '18 11:36    Post subject: Reply with quote

Hi Christian,
that works. But without the dynamic hostname.

CustomLog "|bin/rotatelogs.exe ${LOGROOT}/test-%Y-%m-%d.log 86400" common

Back to top

Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1