For compliance reasons we need to be able to store/search/view website access logs.

Currently Enhance doesn't make this possible by default as they're cleared after being processed (every few minutes).

How is everyone else getting around this? Is there any way to keep the logs?

    Dan No, Enhance team has to fix it.

    • Edited

    For nginx you can add custom log directive to VirtualHost config:

    access_log "/var/www/<site-id>/access.log";
    Then install logrotate to enhance and set something like:

    /etc/logrotate.d/access-logs

    /var/www/*/access.log {
            weekly
            missingok
            rotate 6
            compress
            nocreate
            delaycompress
            notifempty
            copytruncate
    }

    Copytruncate is not an ideal, but it does not require a reload of the webserver configuration.

    2 months later

    Anyone figured out how to do this hack with Apache?
    Would also love to have at least a few days of logs...

      tstrand I use something like this;

      nohup tail -qF /var/local/enhance/webserver_logs/*.log > /root/webserver_logs.log 2>&1 &

      I add @reboot root sleep 30; before the command in crontab and use a custom logrotate.

      I just found this for Apache which I didn't know of, but it looks like a good option.

      Write a Reply...
      Follow @enhancecp