Question

How to setup log rotation for Dispatcher on Apache 2.2

Answer, Resolution

Note: You need at least Dispatcher version 4.0.1. Older versions of the dispatcher module for Apache do not support piped logs

Refer to: http://httpd.apache.org/docs/2.2/logs.html

Here is a sample configuration for dispatcher in httpd.conf:

... 
<IfModule disp_apache2.c>
    # location of the configuration file. eg: 'conf/dispatcher.any' 
    DispatcherConfig conf/dispatcher.any

    # location of the dispatcher log file. eg: 'logs/dispatcher.log' 
    DispatcherLog '|/usr/local/apache/bin/rotatelogs /var/logs/%Y-%m-%d-dispatcher.log 86400 -240'

    # log level for the dispatcher log 
    # 0 Errors 
    # 1 Warnings 
    # 2 Infos 
    # 3 Debug 
    DispatcherLogLevel 1 

    # if turned to 1, the dispatcher looks like a normal module 
    DispatcherNoServerHeader 0 

    # if turned to 1, request to / are not handled by the dispatcher 
    # use the mod_alias then for the correct mapping 
    DispatcherDeclineRoot 0 

    # if turned to 1, the dispatcher uses the URL already processed 
    # by handlers preceeding the dispatcher (i.e. mod_rewrite) 
    # instead of the original one passed to the web server. 
    DispatcherUseProcessedURL 0 

</IfModule> ... 

To implement similar functionality with older versions of dispatcher:

Applies

Dispatcher > 4.0.1