Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a Tomcat 7 server running in a VM that has very little disk space (20G).

Over the course of a few days Tomcat will fill the space with logging info (usually about 15G before it runs out).

I've tried turning down the log level (from INFO to SEVERE) in the logging.properties file, I've also tried sending the log info to /dev/null.

It doesn't seem to work as I still get a full log directory after no time at all.

Can I put a file size limit on the log files? Is something overriding the properties I'm setting?

Where can I find this information? My Google Fu just returns information about logging from within an application using JULI.

share|improve this question

migrated from stackoverflow.com Mar 28 '11 at 4:41

This question came from our site for professional and enthusiast programmers.

    
I've just seen this question: stackoverflow.com/questions/5144095/…. The answer to this is not good for me because if I delete the log files they still take up space until the server is restarted. –  WilliamMayor Mar 27 '11 at 22:08
    
Which log file is getting large? –  ericacm Mar 27 '11 at 22:22
    
Also, what kind of log messages are going into it? –  ericacm Mar 28 '11 at 0:45
    
was this issue resolved ? –  YoK Mar 28 '12 at 9:19

1 Answer 1

Play around with RollingFileAppenders (Log4J) to roll them when they get too large and use cron jobs to delete old logs. You can easily limit logfiles to 50M or so.

To shut down logging completely rename the logging.properties into something else. Tomcat will then default to use console logging which is almost like > /dev/null. Finally put a comment around all valves in your server.xml to mute those too. Now shut the tomcat down, delete all remaining logfiles and start it back up. There should be no logfiles created in /log.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.