Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Starting Tomcat 4.x specifying an output console log file with the highest possible level of logs:

Code Block
xml
xml
<cargo containerId="tomcat4x" home="c:/apps/jakarta-tomcat-4.1.30" 
    action="start"
    output="target/output.log"
    append="false">
  <configuration home="target/tomcat-home">
    <property name="cargo.logging" value="high"/>
  </configuration>
</cargo>

Use the append="true|false" attribute for controlling the log file creation behavior.

...

Starting Tomcat 4.x specifying an output console log file with the highest possible level of logs:

Code Block
xml
xml
<container>
  <containerId>tomcat4x</containerId>
  <home>c:/apps/jakarta-tomcat-4.1.30</home>
  <output>target/output.log</output>
  <append>false</append>
</container>
<configuration>
  <properties>
    <cargo.logging>high</cargo.logging>
  </properties>
</configuration> 

Use the append="true|false" attribute for controlling the log file creation behavior.

...

Some Cargo classes support generation of logs. This is implemented through the notion of Logger and levels are managed using LogLevel. There are 3 levels defined in o.c.c.util.log.LogLevel: LogLevel.DEBUG, LogLevel.INFO and LogLevel.WARN (LogLevel.INFO is the default value).

For example to turn on logging monitoring on a Container class, you can use:

Code Block
Logger fileLogger = new FileLogger(new File("c:/tmp/cargo.log"), true);
fileLogger.setLevel(LoggingLevelLogLevel.HIGHDEBUG);
container.setLogger(fileLogger);

...

When using the Ant tasks, you CARGO will by default use the AntLogger. You can specify the log level using the logLevel attribute, and the log file by using the log and logLevel attributes attribute. For example:

Code Block
xml
xml
<cargo containerId="resin3xtomcat4x" [...] home="c:/apps/jakarta-tomcat-4.1.30" 
    action="start"
    logLevel="debug"
    log="target/cargo.log"/>

Use the append="true|false" attribute for controlling the log file creation behavior.

Example Example using the Maven2/Maven3 plugin

When using the Maven2/Maven3 plugin, CARGO will by default use the MavenLogger.

When you use mvn with the -e option, both Maven itself and the CARGO plugin will log everything in debug mode.

If you want to use the plugin in debug mode without having Maven itself in debug mode, you can specify the log level using the logLevel attribute, and the log file by using the log attribute. For example:

Code Block
xml
xml
<container>
  <containerId>tomcat4x</containerId>
  <home>c:/apps/jakarta-tomcat-4.1.30</home>
  <log>target/cargo.log</log>
  <logLevel>debug</logLevel>
</container>