Community
Participate
Working Groups
Created attachment 201982 [details] Virgo Startup Listener bundle I'm trying to use JUL from a simple bundle [1] running in Virgo. The resulting message has the format: [2011-08-23 11:58:05.040] ERROR fs-watcher System.err Aug 23, 2011 11:58:05 AM org.cloudfoundry.virgo.startup.VirgoStartupListener start [2011-08-23 11:58:05.040] ERROR fs-watcher System.err INFO: Starting deployment of [artifacts/d20110823-12157-1727cjf.jar] [1] https://github.com/hsiliev/vcap-java/blob/virgo/plugins/org.cloudfoundry.plugins.virgo/src/main/java/org/cloudfoundry/virgo/startup/VirgoStartupListener.java
This might be connected to bug 352768
(In reply to comment #1) > This might be connected to bug 352768 That seems likely. For bug 352768, I believe the default Tomcat support for JUL is redirecting logs to syserr. Apparently we need to write our own console handler to fix this.
I installed jul-to-slf4j bridge [1] in the medic and configured the LevelChangePropagator [2]. For this to work I had to move slf4j.bridge bundle (containing the SLF4JBridgeHandler) in the kernel so medic can call its install() method. The LevelChangePropagator is not available in logback 0.9.24 so I updated logback to 0.9.28. This proved to be enough to get the JUL logs working for both my test bundle and Tomcat. One complication however is the fact that JUL has by default ConsoleHandler configured on root logger. This is the reason to have the JUL log entries twice - the first time from the logger and the second from System.err/out. To solve the problem with the default ConsoleHandler I added some logic that removes it from the root logger. Since someone may have configuration including ConsoleHandler I made this configurable. The move of slf4j.bridge bundle requires some tweaking of the test configurations. [1] http://www.slf4j.org/legacy.html#jul-to-slf4j [2] http://logback.qos.ch/manual/configuration.html#LevelChangePropagator [3] http://www.slf4j.org/api/org/slf4j/bridge/SLF4JBridgeHandler.html
Added dependency on bug 358129 since the medic configuration is not used
The bridge and propagator are in medic with commit 1245d0a5a027552852aa621a29728fb8a81f7069 The kernel includes SLF4J bridge with commit d809f45a5245d7b57a6353b06e6f791203baabbb Changed tests with commits: 1848e47681a15d8dd25ab6d3e71c59f946d68b7e - app b058f3af7b706959ab2e97df62a0c0cb4aa26c68 - web b0ed9b6ed0dbc30dc2a8fc8164b3386e9ed147fc - snaps
User Guide updated with commit d86764f9d325827efdf65789363bbeff866ce506
Cherry picked in 3.0.2 with * kernel: aea42be2467a7e40bda5ff27a12defca1beea301 * medic: f0a1a06ca118f5dc8090826bb3263f1c55d83428 * app: 5743506ef33abd47111542291cfea59934d30015 * web: b6515557c30ff87f054ac22ab5036e199e9de2ec * snaps: e15b88b14485596e67dd6b477092e275db456334 * doc: dbe4b2542ae7820ea71a14c58fca3711251fe9f3