« Coding Convention: Put identifying parameters first | Main | iPods skip with large files »

Reducing the size of Checkstyle logs

If you use Checkstyle, especially as part of an automated build, you may notice that the size of the log file can be a bit big. I did, anyway, so I wrote a stylesheet to trim it down to size.

Checkstyle puts lots of entries into its log file; a minimum of 1 per file, possibly more. This can make the log file quite large; a typical log file for my current project is about 1/2 MB. This chews up disk space when you have several hundred archived logs, and it slows down processing of the log file.

The above stylesheet is easily integrated into your ant scripts, using the Ant style task, and generally makes life a lot nicer.

Comments (4)

Michael:

Thanks Robert ! Will come in handy...

VincentMassol:

hmm... so why you do you use checkstyle if you're not reducing the errors it find? :-) Also, if the errors are not getting fixed quickly maybe it's because they're not important and should be removed from the checkstyle config file?

Personally, I prefer to reduce the number of checkstyle checks done and make the one that we decide to keep fail the build. That way there's no need for HTML page generation and no log size issue! :-)

Vincent, I think you misunderstood the purpose of the filter. The filter removes the files that pass the checkstyle checks, leaving just the errors.

The main use I have for this is as part of my Cruisecontrol builds; I'm only interested in the errors in this scenario, so taking out the noise speeds up the log file processing a lot.

Tom:

Thanks Robert. Very handy indeed, especially if you work on a project with a lot of weird, but enforced (ie. will break the build), style rules.

Post a comment


About

This page contains a single entry from the blog posted on March 10, 2005 2:32 PM.

The previous post in this blog was Coding Convention: Put identifying parameters first.

The next post in this blog is iPods skip with large files.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.35