RE: addEventlistener question
Jacob Kjome <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
At 10:11 AM 3/4/2003 -0500, you wrote:
>4) I'm having trouble getting log4j to find any appenders. I used the web.xml
>and log4j.xml from the latest BarracudaDiscRack as an example. I tried to
>sepecify logging of debug message, but I got nothing conclusive.
Make sure you modify the log4j.xml. Note that the FileAppender is set up
with a dynamic variable: "${BarracudaDiscRack.log.home}". Change
"BarracudaDiscRack" to the name of your context. For instance, if your
context path is "/myapp", then it would be "${myapp.log.home}". Look at
sample.log4j.xml in BarracudaDiscRack and notice that this value is
dynamically generated by the build using a filter copy of sample.log4j.xml
to log4j.xml.
Now, in the web.xml, make sure that you have....
<listener>
<listener-class>
org.apache.log4j.servlet.InitContextListener
</listener-class>
</listener>
That listener class will determine the location of the [context
name].log.home variable dynamically. Output will go to file if you haven't
changed the <appender-ref ref="A2"/> in the <root> logger. Make sure to
add your other loggers to the log4j.xml if you want things logged. You can
also change this at runtime since confgureAndWatch is done by
default. Additionally, you can put the barracuda-config.jar in your app
and add the following to your event-gateway.xml file...
<event-gateway class="org.enhydra.barracuda.config.BarracudaConfig" />
Then you can go to http://localhost:8080/myapp/GetBConfig.event
You can now turn on and off various loggers and set different levels.
Let me know if you still have problems logging.
Jake