Find the answer to your Linux question:
Results 1 to 3 of 3
At my work we have several production applications running on top of Apache Tomcat 6. The programs have a lot of auditing information (for billing purposes) and they can get ...
  1. #1
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496

    STDOUT Logfile size in Apache Tomcat

    At my work we have several production applications running on top of Apache Tomcat 6. The programs have a lot of auditing information (for billing purposes) and they can get rather large, growing to several gigabytes over the course of a few days. At present the only way to limit the size of those log files is to restart the Apache service every other day or so manually.

    Is anyone more familiar with Tomcat? Is there a way to either limit the size of the log file or tell Apache to roll over the log and start a new one each day?
    Registered Linux user #270181
    TechieMoe's Tech Rants

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    have a look at http://cronolog.org/

    At least in apache, you can pipe logs to an external program.
    (I am unsure about tomcat in that regard)

    Log into cronolog and cronolog takes care about creating and naming new logfiles based on date and time.
    No more need to restart apache.

    It looks like this:
    .
    .
    CustomLog "| /usr/sbin/cronolog -S /var/log/apache_access.log /var/log/apache_access.log-%Y%m%d" combined

    And yes it is production ready.
    I am using it on about 70 machines running apache/php for one website.
    That also creates a few kbyte of access logs
    Last edited by Irithori; 12-23-2009 at 05:59 PM.
    You must always face the curtain with a bow.

  3. #3
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,301
    Also consider logrotate
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...