It can happen that the container does not start or stop as expected. Or that some deployable does not deploy fine. Or whatever else! Here is a short list of things you can do to try debugging the problem.
Redirecting container output to a file
The container.setOutput(File) API allows you redirect the container console (stdout) to a file. This is the first file you should check in case of problem.
Getting some Cargo logs
Some Cargo classes support generation of logs. This is implemented through the notion of Monitor.
For example to turn on logging monitoring on a Container class, you can use:
There are several Monitors that are readily available in the Cargo distribution:
- FileMonitor: logs messages to a file
- SimpleMonitor: logs messages to the console (stdout)
Turning on container logs
Cargo is able to configure containers to generate various levels logs. There are 3 levels defined: "info", "warning" and "error". You can turn container logging by using the following API:
The generated log files will then be found in the Working directory you have specified on the container (through the container.setWorkingDir() call).