Sourcefabric Manuals

 English |  Español |  Français |  Italiano |  Português |  Русский |  Shqip

Newscoop 4.2 for Journalists and Editors

Log file maintenance

The Newscoop database has an audit_event table which logs the actions of your publication's staff in the administration interface. For a busy publication, this table can grow very quickly. To keep the size of this table down, you may prefer to write audit data which is more than a week old into a log file instead. A maintenance script for this task is provided with Newscoop 4, in the scripts/ sub-directory of the Newscoop installation. It can be run via a cron job in the /etc/cron.daily/ directory, or executed manually as required.

For a Newscoop installation where the DocumentRoot is /var/lib/newscoop the script can be run from the command line of your server, as the root user or with sudo, like this:

sudo php /var/lib/newscoop/scripts/newscoop.php log:maintenance
Log data processed.

What this script does is to look for events older than seven days, flush all those events from the database, and write them to a newscoop-audit.log file in the log/ sub-directory of your Newscoop installation, such as /var/lib/newscoop/log/newscoop-audit.log

After this script has run, your staff will only see the last seven days of audited actions when clicking Configure, then Logs in the administration interface menu. See the chapter Logs for details.

Log rotation

A program such as logrotate can be used to to compress and rotate the newscoop-audit.log file. An example logrotate configuration might look as follows:
    /var/lib/newscoop/log/*.log {
                                 weekly
                                 missingok
                                 rotate 8
                                 compress
                                 delaycompress
                                 create 0640 www-data root
                                 }
    

    On Debian or Ubuntu GNU/Linux, this configuration could be saved to a file such as /etc/logrotate.d/newscoop and would then be read automatically the next time that the /etc/cron.daily/logrotate script runs.

    There has been error in communication with Booktype server. Not sure right now where is the problem.

    You should refresh this page.