Rotate log files

To keep log files under control, move them to an archive regularly.

Move log files

  1. Create a directory called 'testlink' and provide the appropriate permissions for it:
    • cd /opt/collabnet/teamforge/log/
    • mkdir testlink
    • chown sf-admin:sf-admin testlink/
  2. Do the following to move the default TestLink log, var/testlink/log to the TeamForge log subfolder, /opt/collabnet/teamforg/log/testlink/:
    1. vim /opt/testlink/testlink-1.9.11/custom_config.inc.php
    2. Enter the following value:
      • $tlCfg->log_path = '/opt/collabnet/teamforge/log/testlink/'
    3. Restart Apache.
      • /etc/init.d/httpd restart

Set up log rotation

  1. Do the following to set up the log rotation in TeamForge:
    1. In the TeamForge site, edit site-options.conf by adding the TestLink folder name to the following token:
      • vim /opt/collabnet/teamforge-installer/8.0.0.0/conf/site-options.conf
    2. Set the log rotation token as follows:
      • SCLOGROT_TRANSFER_LOGTYPES=apps httpd integration phoenix pgsql projecttraker runtime codesearch gerrit cliServer testlink
    3. Recreate the runtime.
      • /etc/init.d/collabnet stop all
      • ./install.sh -r -V -d /opt/collabnet/teamforge
      • /etc/init.d/collabnet start all
    4. Create a directory called 'testlink' and provide the appropriate permissions for it:
      • cd /opt/collabnet/teamforge/log/
      • mkdir testlink
      • chown sf-admin:sf-admin testlink/
    5. If the site is SELinux enabled, then run the following command:
      • /usr/sbin/semanage fcontext -a -t httpd_sys_rw_content_t '/opt/collabnet/teamforge/log/testlink(/.*)?'
      • /sbin/restorecon -R -v /opt/collabnet/teamforge/log/testlink
Log Locations