Hi Carey,
Ah, you bring up a good point. One should be able to set a directory outside the .war file by setting the config in the web.xml and the system property should be able to be set to that. That was an oversight which happened, probably, because I never run the context directly from a .war file. Instead, I run it from a WAR directory structure. Also, I had always assumed I'd just use the console appender when running straight out of a .war. You are right, that needs to be changed. It is most certainly doable and there should be no need to modify the log4j.xml, other than add loggers or modify the ${[context path].log.home} variable to match the context name of your current webapp.
You are welcome to modify the code. If you would send me your mods, it would be appreciated. I will try to make the changes myself within the week if you just want to wait for my changes. Make sure to ping me if you haven't heard anything from me in a few days.
Thanks for the feedback!
Jake
At 07:40 PM 1/14/2003 -0800, you wrote:
Hello Jacob,
Thanks for the code and examples, looks to be exactly what I need. My only question is, and using your examples as reference, if I am deploying my web app via a .war file, and I want to create a FileAppender, do I have to hard code the physical path for the file in my log4j.xml. In your example, the Barracuda.log.home system variable is not available via .war. Is there no other way to dyamically derive the path for the file appender if deploying via .war?
Thanks again for your help.
Regards,
Carey
On Tue, 14 Jan 2003 18:55:48 -0600
Jacob Kjome <[EMAIL PROTECTED]> wrote:
Here is the promised initialization setup. Read "Usage.txt" in the attached zip file. I included both source and pre-built jars. I also included a sample logj4.xml file. See Usage.txt for specifics on what is unique about this log4j.xml file and for other info like web.xml config.
Oh, and Mark, I plan to submit this stuff under the Apache license. I just want to clean some stuff up first. I'll do that within the week. For now, you can take a look at what things will look like and provide some feedback.
Let me know if you have questions...
Jake
At 02:22 PM 1/14/2003 -0800, you wrote:
Thanks Jacob,
If you could pass on your updated code when you have time, I would greatly appreciate that.
Regards,
Carey
On Tue, 14 Jan 2003 13:03:56 -0600
Jacob Kjome <[EMAIL PROTECTED]> wrote:
Hello Carey,
Note that the stuff about Barracuda in my previous message will be
moving to Log4j-1.3. Some have already moved
(ContextClassLoaderSelector). However, for the time being, things
will exist in both places until Log4j-1.3 is released.
Just wanted to point that out.
Jake
Tuesday, January 14, 2003, 12:18:03 PM, you wrote:
CB> Hi,
CB> I am attempting to deploy a web application in WebLogic CB> via a war file. Since I have no way of determing the CB> actual path that Weblogic will use for deploying my war CB> file, I need a way to access my xml file that holds my CB> log4j properties. I can use CB> servletContext.getResourceAsStream() to get an InputStream CB> object of the xml file. With that what is the best way to CB> load my properties. I see there is a CB> DomConfigurator.doConfigure(InputStream, CB> LoggerRepository). Will this work and if so, what do I CB> pass in for the LoggerRepository object (not familiar with CB> that). In addition, is there a way to get the capability CB> of the watchdog with this?
CB> Thanks for your help!
CB> Carey
CB> --
CB> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
CB> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- Best regards,
Jacob mailto:[EMAIL PROTECTED]
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>