I am using org.apache.tools.ant.listener.Log4jListener to control logging using my ant script. ant script has a high degree of configuration and is designed to run in various ways with different parameters, and therefore I need to be able to register in the files specified at runtime. I have log4j.properties, which defines the log file that will be build.log, and despite my attempts to run ant override the properties defined in log4j.properties, were unsuccessful.
The line ignores them and continues to write to build.log. I did not find much support in writing custom files, if only in Java their class is Logger.
Maybe I'm thinking about it wrong. log4j.properties is not treated the same as the properties file in ant script (therefore, it is overridden from the command line)? Is there a way that I can do this wisely without creating a custom task or anything else?
source
share