Details

Description

If you define container log, for example by output element of Maven plugin, and use Cargo for starting and stopping of container then container log stays empty in some cases.

It can be simulated for example by running SystemPropertyCapabilityTest with WildFly container. Test pass, but output.log file is empty.

This is caused by way how Ant library, used by Cargo for handling of java commands, takes care of logging. Ant use LazyFileOutputStream to write content to log file. Log file is created lazily in case if it is needed, in case if it isn't needed then there is created empty log file when java command finishes.
Cargo sets both output stream and error stream to same log file. In case one of those streams doesn't write anything (for example for WildFly there is used just output stream, error stream isn't used) then this empty stream tries to create log file when container is shut down - overriding content of log file with empty file.