Better loggin

Discussion in 'Apache' started by Christian Dubé, Oct 27, 2015.

Tags:
  1. Christian Dubé

    Christian Dubé New Member

    Getting back from ZendCon 2015, I realized many example/sessions used Apache config and none of them used custom logs. If you run a single application, it may be fine. If you run multiple applications or use multiple containers (we use a different VirtualHost for each developer), then custom logs is simple to set up and will help you debug problems.

    In you http.conf file
    Either
    /www/zendsvr/conf/httpd.conf
    or
    /www/zendsvr6/conf/httpd.conf

    or prefered Zend's method: (here you can have has many conf file containing a single VirtualHost, simply change MyApp to whatever represent your app)
    /usr/local/zendsvr/etc/sites.d/vhost_MyApp.conf
    /usr/local/zendsvr/etc/sites.d/vhost_MyApp_dev.conf
    /usr/local/zendsvr/etc/sites.d/vhost_IsApp.conf

    By adding the lines in bold to your own conf, you will separate every request/error made to this containers.
    <VirtualHost *:26589>
    DocumentRoot /www/MyApp/public

    SetEnv APPLICATION_ENV "development"
    ErrorLog /www/weblog/MyApp_error.log
    CustomLog /www/weblog/MyApp_access.log combined


    <Directory /www/MyApp/public>
    ## configs
    </Directory>

    </VirtualHost>

    Note: the actual path needs to exist and give QTMHHTTP *RWX access
     
    kingston likes this.

Share This Page