Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004

    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

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    have a look at

    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
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Either at home or at work or down the pub
    Also consider logrotate
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!

    The Fifth Continent

  4. $spacer_open

Posting Permissions

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