On 11/27/2012 06:03 PM, Max Spring wrote:
I'm struggling getting a custom formatter to play under hpi:run.
I can pass my own logging.properties on the command line:
mvn hpi:run -Djava.util.logging.config.file=my-logging.properties
but my formatter doesn't get used.
I haven't read the code, but I suspect java.util.logging is using the
system property value before Maven gets to process its command line
arguments and makes the corresponding System.setProperty(...) call.
Try setting it via MAVEN_OPTS env variable.
I can switch on/off the built-in XMLFormatter.
This proves that my-logging.properties are active:
java.util.logging.ConsoleHandler.formatter = org.example.MyFormatter
# java.util.logging.ConsoleHandler.formatter =
java.util.logging.XMLFormatter
I suspect this is similar to this problem:
http://jenkins.361315.n4.nabble.com/how-to-set-logging-properties-td3479817.html
But I can't figure out how to make my formatter class visible.
Adding it to the Jenkins war doesn't do the trick here.
Has anyone solved this?
Thanks!
-Max
--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/
Try Nectar, our professional version of Jenkins