How to rotate your Tomcat catalina.out log file

In Incorta Analytics, Version 4.x, both the analytics service and the loader service rely on Tomcat to drive the service.  Tomcat's primary log file is called catalina.out.  With a lot of load activity and end user activity, this catalina.out file can grow to be very large for both services.  As with many Java applications, you can rotate these logs periodically to keep any single file from growing too large.  

To setup log file rotation for your catalina.out files after they grow larger than 1024MB, use the following procedure: 

Note: you will need administrative privileges on your linux server to conduct these steps.

1. Create a file called tomcat:


2. Copy the following contents into this tomcat file:

/home/incorta/IncortaAnalytics/IncortaNode/services/<GUID of your service>/logs/catalina.out {
  rotate 7
  size 1024M

Make sure that the path /home/incorta/IncortaAnalytics/IncortaNode/services/<GUID of your service>/logs/catalina.out above is adjusted to point to your installation's specific Tomcat catalina.out file.

Here's what each component in the file means:

  • daily - rotates the catalina.out daily
  • rotate – keeps up to 7 log files
  • compress – compresses the rotated files
  • size – rotates if the size of catalina.out is bigger than 1024MB

That's it. You don't need to restart.

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • You may need to update the tomcat file as below to run it as incorta user

    /home/incorta/IncortaAnalytics/IncortaNode/services/3490d4ab-b661-4a22-b502-c60e766fe28b/logs/catalina.out {
      create 0640 incorta incorta
      rotate 7
      size 1024M
      su incorta incorta

    Execute a dry-run to see what logrotate would do if it was actually executed now. Use the -d option followed by the configuration file (you can actually run logrotate by omitting this option)

    sudo logrotate -d /etc/logrotate.d/tomcat
Like5 Follow
  • 1 yr agoLast active
  • 1Replies
  • 1619Views
  • 3 Following

Product Announcement

A new community experience is coming! If you would like to have beta access to provide feedback, please contact us at community@incorta.com.