In addition to the cost of execution, nothing but option 3 is also terribly difficult (*). Also, I'm not sure if there is a Java library that reads an InputStream and converts it into Commons Logging calls. Even if there is, in order to be able to fully control filtering using the configuration on the Java side, you will need to write everything at the trace level to stdout (since C ++ code does not know about the configured log levels), which also sounds excessive.
Go with Log4cxx or create C ++ code that can independently read the configuration file.
(*) Well, option 4 (has a shell script that redirects stderr / stdout from your unmodified C ++ program to a Java program that converts the output to log entries) will not be very complicated.
source share