Uploaded image for project: 'JBoss Web Server'
  1. JBoss Web Server
  2. JWS-1374

tomcat doesn't clean own logs by logrotate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • rpm, tomcat
    • None

      +++ This bug was initially created as a clone of Bug #1701249 +++
      Description of problem:
      I look at system where the tomcat has run for long time. And a lot of old log files exist, I suppose that the logs should be cleaned.

      $ ls  /var/log/tomcat/
      total 931192    <<<<<<<<<<<<<see the high amount of files (!)
      -rw-r--r-- 1 tomcat tomcat     18938 Sep 28  2016 catalina.2016-09-28.log
      -rw-r--r-- 1 tomcat tomcat     28648 Sep 29  2016 catalina.2016-09-29.log
      -rw-r--r-- 1 tomcat tomcat      9461 Sep 30  2016 catalina.2016-09-30.log
      -rw-r--r-- 1 tomcat tomcat      9675 Oct  1  2016 catalina.2016-10-01.log
      -rw-r--r-- 1 tomcat tomcat      9925 Oct  3  2016 catalina.2016-10-03.log
      -rw-r--r-- 1 tomcat tomcat      9478 Oct  4  2016 catalina.2016-10-04.log
      -rw-r--r-- 1 tomcat tomcat     67972 Oct  5  2016 catalina.2016-10-05.log
      -rw-r--r-- 1 tomcat tomcat      9670 Oct  6  2016 catalina.2016-10-06.log
      -rw-r--r-- 1 tomcat tomcat      9674 Oct  7  2016 catalina.2016-10-07.log
      -rw-r--r-- 1 tomcat tomcat      9674 Oct  8  2016 catalina.2016-10-08.log
      -rw-r--r-- 1 tomcat tomcat      9674 Oct  9  2016 catalina.2016-10-09.log
      -rw-r--r-- 1 tomcat tomcat      9727 Oct 10  2016 catalina.2016-10-10.log
      -rw-r--r-- 1 tomcat tomcat      9477 Oct 11  2016 catalina.2016-10-11.log
      -rw-r--r-- 1 tomcat tomcat      9674 Oct 12  2016 catalina.2016-10-12.log
      -rw-r--r-- 1 tomcat tomcat      9675 Oct 13  2016 catalina.2016-10-13.log
      -rw-r--r-- 1 tomcat tomcat       250 Oct 17  2016 catalina.2016-10-17.log
      -rw-r--r-- 1 tomcat tomcat       250 Oct 24  2016 catalina.2016-10-24.log
      -rw-r--r-- 1 tomcat tomcat       250 Oct 31  2016 catalina.2016-10-31.log
      -rw-r--r-- 1 tomcat tomcat     59532 Nov  1  2016 catalina.2016-11-01.log
      -rw-r--r-- 1 tomcat tomcat     28430 Nov  4  2016 catalina.2016-11-04.log
      -rw-r--r-- 1 tomcat tomcat       250 Nov  7  2016 catalina.2016-11-07.log
      -rw-r--r-- 1 tomcat tomcat       250 Nov 14  2016 catalina.2016-11-14.log
      -rw-r--r-- 1 tomcat tomcat    237373 Nov 17  2016 catalina.2016-11-17.log
      -rw-r--r-- 1 tomcat tomcat       250 Nov 21  2016 catalina.2016-11-21.log
      -rw-r--r-- 1 tomcat tomcat       250 Nov 28  2016 catalina.2016-11-28.log
      -rw-r--r-- 1 tomcat tomcat     34337 Nov 29  2016 catalina.2016-11-29.log
      -rw-r--r-- 1 tomcat tomcat     34003 Nov 30  2016 catalina.2016-11-30.log
      -rw-r--r-- 1 tomcat tomcat     61087 Dec  1  2016 catalina.2016-12-01.log
      -rw-r--r-- 1 tomcat tomcat     68240 Dec  2  2016 catalina.2016-12-02.log
      -rw-r--r-- 1 tomcat tomcat     34581 Dec  3  2016 catalina.2016-12-03.log
      -rw-r--r-- 1 tomcat tomcat     30584 Dec  4  2016 catalina.2016-12-04.log
      -rw-r--r-- 1 tomcat tomcat     32703 Dec  5  2016 catalina.2016-12-05.log
      -rw-r--r-- 1 tomcat tomcat     35446 Dec  6  2016 catalina.2016-12-06.log
      -rw-r--r-- 1 tomcat tomcat     35461 Dec  7  2016 catalina.2016-12-07.log
      -rw-r--r-- 1 tomcat tomcat     35162 Dec  8  2016 catalina.2016-12-08.log
      -rw-r--r-- 1 tomcat tomcat     79718 Dec  9  2016 catalina.2016-12-09.log
      -rw-r--r-- 1 tomcat tomcat     35161 Dec 10  2016 catalina.2016-12-10.log
      -rw-r--r-- 1 tomcat tomcat     31463 Dec 11  2016 catalina.2016-12-11.log
      -rw-r--r-- 1 tomcat tomcat     33837 Dec 12  2016 catalina.2016-12-12.log
      -rw-r--r-- 1 tomcat tomcat     34005 Dec 13  2016 catalina.2016-12-13.log
      .
      snip
      .
      -rw-r--r-- 1 tomcat tomcat         0 Mar  1 20:10 manager.2019-03-01.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  2 20:11 manager.2019-03-02.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  3 20:11 manager.2019-03-03.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  4 20:10 manager.2019-03-04.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  5 20:11 manager.2019-03-05.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  6 07:32 manager.2019-03-06.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  7 20:09 manager.2019-03-07.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  8 20:11 manager.2019-03-08.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar  9 20:09 manager.2019-03-09.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 10 20:10 manager.2019-03-10.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 11 20:11 manager.2019-03-11.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 12 20:10 manager.2019-03-12.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 13 20:10 manager.2019-03-13.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 14 13:46 manager.2019-03-14.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 15 20:10 manager.2019-03-15.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 16 20:10 manager.2019-03-16.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 17 20:11 manager.2019-03-17.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 18 20:12 manager.2019-03-18.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 19 20:12 manager.2019-03-19.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 20 20:11 manager.2019-03-20.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 21 20:10 manager.2019-03-21.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 22 20:11 manager.2019-03-22.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 23 20:09 manager.2019-03-23.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 24 20:11 manager.2019-03-24.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 25 20:11 manager.2019-03-25.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 26 20:12 manager.2019-03-26.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 27 20:12 manager.2019-03-27.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 28 10:19 manager.2019-03-28.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 29 20:11 manager.2019-03-29.log
      -rw-r--r-- 1 tomcat tomcat         0 Mar 31 20:12 manager.2019-03-31.log
      -rw-r--r-- 1 tomcat tomcat         0 Apr  1 07:11 manager.2019-04-01.log
      -rw-r--r-- 1 tomcat tomcat         0 Apr  2 09:30 manager.2019-04-02.log
      -rw-r--r-- 1 tomcat tomcat         0 Apr  3 14:26 manager.2019-04-03.log
      -rw-r--r-- 1 tomcat tomcat         0 Apr  4 07:30 manager.2019-04-04.log
      
      $ cat etc/logrotate.d/tomcat 
      /var/log/tomcat/catalina.out {
          copytruncate
          weekly
          rotate 52
          compress
          missingok
          create 0644 tomcat tomcat
      }
      

      Version-Release number of selected component (if applicable):

      $ cat etc/redhat-release 
      Red Hat Enterprise Linux Server release 7.6 (Maipo)
      $ grep -i tomcat installed-rpms 
      lh555.server.raiffeisen.ch-tomcat-1.0-1.noarch              Tue Feb 13 07:04:46 2018
      tomcat-7.0.76-8.el7_5.noarch                                Wed Nov 14 09:19:38 2018
      tomcat-el-2.2-api-7.0.76-8.el7_5.noarch                     Wed Nov 14 09:18:39 2018
      tomcat-jsp-2.2-api-7.0.76-8.el7_5.noarch                    Wed Nov 14 09:18:05 2018
      tomcat-lib-7.0.76-8.el7_5.noarch                            Wed Nov 14 09:18:40 2018
      tomcat-servlet-3.0-api-7.0.76-8.el7_5.noarch                Wed Nov 14 09:18:04 2018
      

      How reproducible:
      alawys

      Steps to Reproduce:
      1. run tomcat long time
      2. show content of directory with logs

      Actual results:
      A lot of logs files

      Expected results:
      old log files was compressed or remove

      Additional info:

      The same bug was opened for rhel 6.9 but was closed as WONTFIX due to "Red Hat Enterprise Linux 6 is in the Production 3 Phase."

              rhn-support-csutherl Coty Sutherland
              rhn-support-csutherl Coty Sutherland
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: