logo
Apache Lounge
Webmasters

 


About

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.

or

Bitcoin

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
chkaufmann



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.

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: 6531
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.

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


Mario
Back to top


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