Dashboard > CruiseControl > Frequently Asked Questions > UseLogger
UseLogger Log In View a printable version of the current page.

Added by Robert Watkins , last edited by Joris Kuipers on Dec 10, 2004  (view change)
Labels: 
(None)

Note: The following feature is in release 2.0.2; using 2.0.1 or earlier CC behaves as though useLogger=true.

If you are using Ant 1.5 or later you can drastically reduce the amount of information logged by setting useLogger="true" on the antBuilder element. This will make Ant log only messages with priority INFO and higher, rather than always getting all the debug level information. Note that this has nothing to do with LOG4J log levels, this is all Ant specific.

If you use useLogger="true", you can make your log files even smaller by making Ant only log warnings and errors. An easy way to do that is to set the ANT_ARGS environment variable to -quiet. Have a look at the Ant manual for more info on Loggers vs. Listeners and Options.

However one often unexpected side effect of using the logger – as opposed to the listener used when useLogger="false" – is that the messages from the ant build will not display on the console. This can be a problem if you are trying to debug a problem with your ant build but can be a benefit if you are trying to debug an issue with your cruisecontrol configuration.

So the trade off is:

useLogger="true"

  • smaller log file
  • reduced memory use (can sometimes fix OutOfMemoryError)
  • no ant spam in console
  • doesn't work with older versions of Ant

useLogger="false"

  • can see ant messages
  • compatible with older versions of Ant

(Regarding CVS @ 2002/12/18) It appears that useLogger="false" disrupts the HTMLEmailPublisher. The console shows a number of XML errors, and the resulting email contains only the JSP link.

And when you set useLogger="true" the problem went away? I find that surprising because useLogger="false" is the default setting. Or perhaps this isn't a generic issue but true due to something unique about your case?


This is all very interesting, but here's one thing I don't get:

I have some old log files from back in Jan 2003.
These were made with CC 2.0.1 and Ant 1.4
None of them contain debug output. Average size is ~50K

I have another machine that's running CC 2.0.2 right now.
All log files have debug output, and average size is 3MB

It seems like CC 2.0.2 + Ant 1.4 makes bigger files regardless of UseLogger (which I've not set at all)

Any thoughts?

As noted at the top CC 2.0.1 was hard coded for useLogger=true, while CC 2.0.2 defaults to useLogger=false. What you're seeing is entirely consistent w/that.


Example:

<schedule interval="300">
      <ant buildfile="build.xml" target="cruise" antscript="build.bat" uselogger="true"/>
    </schedule>

see other Frequently Asked Questions

Powered by a free Atlassian Confluence Open Source Project / Non-profit License granted to ThoughtWorks, Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators