java - The build file called using <ant> task resets the logging configs of the caller -


two projects: product (project-a) , auto benchmark project (project-b).

in b's build file, need call a's build file run build , bundle-with-app-server process this:

<ant antfile="${build-file-a}" inheritall="false" target="all" /> 

and, in project b, have lot of ant tasks output messages using java.util.logging (the jdk logging framework).

the problem is, after line, jdk logger outputs disappear.

with debugging, find that, during initialzation of project a's build file, staticly defined thing in project run logmanager.readconfiguration(inputstream), loads config file contains logger configuration of single class.

and during readconfiguration, logmanager.reset() called; during reset, each handler of each logger removed. <ant> load target build file same process of caller, handlers removed.

so, except configurated one, every other class use jdk logger can't output messages due lack of output handler.

my question is:

is there way solve problem, other than:

  1. use <exec> run project a's build file;
  2. write task run readconfiguration() restore default jdk logging settings default configuration file after <ant> call.
  3. use ant's own logging framework (task.log(), etc).

please note can't modify project prevent problem.

you might able create subclass of logmanager , override reset , 2 readconfiguration methods install handlers need. use java.util.logging.config.class system property install custom code on statup.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -