Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Apache 2.4 - rotatelogs.exe in VirtualHost |
|
Author |
|
chkaufmann
Joined: 30 Aug 2018 Posts: 2 Location: Switzerland, Berne
|
Posted: Mon 03 Sep '18 22:19 Post subject: Apache 2.4 - rotatelogs.exe in VirtualHost |
|
|
I wonder if it is possible to use variables for path and name of the logfiles.
Code: | <VirtualHost *:80>
ServerName localhost
CustomLog "|bin/rotatelogs.exe D:/logs/localhost-%Y-%m-%d.log 86400" combined
DocumentRoot "${DOCROOT}"
</VirtualHost>
|
Now I would like to do something like this:
Code: | Define LOGROOT "D:/WWW/Logs"
<VirtualHost *:80>
ServerName localhost
CustomLog "|bin/rotatelogs.exe ${LOGROOT}/%HTTP_HOST%-%Y-%m-%d.log 86400" combined
DocumentRoot "${DOCROOT}"
</VirtualHost>
|
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.
Christian |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 05 Sep '18 11:36 Post subject: |
|
|
Hi Christian,
that works. But without the dynamic hostname.
Code: | CustomLog "|bin/rotatelogs.exe ${LOGROOT}/test-%Y-%m-%d.log 86400" common |
Mario |
|
Back to top |
|
|
|
|
|
|