You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Carey Boldenow <c....@cyterasystems.com> on 2003/01/14 19:18:03 UTC
accessing xml properties in war file
Hi,
I am attempting to deploy a web application in WebLogic
via a war file. Since I have no way of determing the
actual path that Weblogic will use for deploying my war
file, I need a way to access my xml file that holds my
log4j properties. I can use
servletContext.getResourceAsStream() to get an InputStream
object of the xml file. With that what is the best way to
load my properties. I see there is a
DomConfigurator.doConfigure(InputStream,
LoggerRepository). Will this work and if so, what do I
pass in for the LoggerRepository object (not familiar with
that). In addition, is there a way to get the capability
of the watchdog with this?
Thanks for your help!
Carey
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
Hello Carey,
See the Log4jInit servlet and Log4jApplicationWatch servlet context
listener in Barracuda. These provide exactly what you need.
http://barracuda.enhydra.org/software/cvs/cvsweb.cgi/Projects/EnhydraOrg/toolsTech/Barracuda/src/org/enhydra/barracuda/webapp/log4j/
http://barracuda.enhydra.org/software/cvs/cvsweb.cgi/Projects/EnhydraOrg/toolsTech/Barracuda/src/org/enhydra/barracuda/log4j/
Actually, I have updated some stuff and am waiting to apply it
to Barracuda once our new server is up and DNS has propogated. I can
send that latest and greatest to you when I get home. In the changes,
The Log4jInit servlet is no longer used in favor of doing everything
in the servlet context listener and the Log4jCRS is super simplified and
renamed to ContextClassLoaderSelector.
And yes, it will provide for properties or dom configuration.
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: <ma...@jakarta.apache.org>
CB> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Best regards,
Jacob mailto:hoju@visi.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
Hi Carey,
Glad that worked for you!
Now we need to figure out why the doctype wasn't resolving properly because
we should be able to leave that in the log4j.xml file. Any ideas from the
Log4j developers?
Jake
At 11:48 AM 1/15/2003 -0800, you wrote:
>Hi Jake,
>
>I did remove the DOCTYPE from my xml document and everything worked just
>fine. Thanks again for all your help on this.
>
>Regards,
>Carey
>
>
>On Wed, 15 Jan 2003 13:41:14 -0600
> Jacob Kjome <ho...@visi.com> wrote:
>>
>>Hi Carey,
>>
>>Note that a couple updates were made since log4j-1.2.7 was released. The
>>changes were to DomConfigurator and Log4jEntityResolver. See...
>>
>>http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/src/java/org/apache/log4j/xml/Attic/Log4jEntityResolver.java?rev=1.1.2.2&only_with_tag=v1_2-branch&content-type=text/vnd.viewcvs-markup
>>
>>http://cvs.apache.org/viewcvs/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java?rev=1.49.2.3&only_with_tag=v1_2-branch&content-type=text/vnd.viewcvs-markup
>>
>>I'm not sure that will, for sure, solve your issue, but it certainly
>>solved the log4j.jar file locking issue.
>>
>>The other thing you can do is try removing the doctype from log4j.xml
>>altogether and see if that works. Based on a report from a Barracuda
>>user, that solved the issue for him when he was serving his app directly
>>from a .war file under Tomcat.
>>
>>Jake
>>
>>
>>At 11:13 AM 1/15/2003 -0800, you wrote:
>>>Well here is the latest. I am able to create an InputStream object of my
>>>log4jProps.xml directly from the .war file in WebLogic. However, the
>>>log4j.dtd file cannot be located (see stacktrace below). I incorporated
>>>the Log4jEntityResolver into my code (see below), but that did not seem
>>>to have any impact at all. I am using the standard DOCTYPE declaration
>>>in my xml file. Any help is greatly appreciated.
>>>
>>>Regards,
>>>Carey
>>>
>>>
>>>[ChangeAwareClassLoader] : Name is :
>>>org/apache/crimson/parser/resources/Message
>>>s_en.properties
>>>[ChangeAwareClassLoader] : Name is :
>>>org/apache/crimson/parser/resources/Message
>>>s_en_US.properties
>>>org.xml.sax.SAXParseException: Relative URI "log4j.dtd"; can not be
>>>resolved wit
>>>hout a base URI.
>>> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
>>> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
>>> at org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
>>> at
>>> org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
>>> at
>>> org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
>>>
>>> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
>>> at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
>>> at
>>> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
>>>
>>> at
>>> org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
>>>.java:185)
>>> at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
>>> at com.cytera.frameworks.common.LogManager.init(LogManager.java:49)
>>> at ServerConfigurator.init(ServerConfigurator.java:76)
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
>>>pl.java:713)
>>> at
>>> weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
>>>
>>>public static void init(String level, InputStream in) {
>>> DocumentBuilderFactory dbfactory =
>>> DocumentBuilderFactory.newInstance();
>>> dbfactory.setNamespaceAware(true);
>>> try {
>>> DocumentBuilder dbuilder = dbfactory.newDocumentBuilder();
>>> dbuilder.setEntityResolver(new Log4jEntityResolver());
>>>
>>>DOMConfigurator.configure(dbuilder.parse(in).getDocumentElement());
>>> }
>>> catch (Exception e) {
>>> e.printStackTrace();
>>> }
>>> }
>>>
>>>
>>>On Wed, 15 Jan 2003 01:03:50 -0600
>>>Jacob Kjome <ho...@visi.com> wrote:
>>>>
>>>>Ug,
>>>>
>>>>Upon further examination of my code, it turns out I knew what I was
>>>>doing after all. If you set the "log4j-log-home" context parameter in
>>>>web.xml (currently commented out because it is an optional parameter
>>>>which will always be system specific if supplied), then you *can* set
>>>>the system property to your custom path, even in the case of serving
>>>>your webapp out of a .war file. Not sure why I missed that before? I
>>>>guess I can't read my own code :-(
>>>>
>>>>See line 108 of the Log4jApplicationWatch.java file to see where I am
>>>>talking about. You just need to make sure to uncomment and set the
>>>>path in the web.xml. For instance...
>>>>
>>>><!-- optional param for use with a File Appender.
>>>> Specifies a path to be read from a log4j xml
>>>> config file as a system property. The property name is
>>>> dynamically generated and takes on the following pattern:
>>>> [webapp name].log.home
>>>> In Barracuda's case, it would be "Barracuda.log.home".
>>>> The path defaults to WEB-INF/logs directory, which is created
>>>> if it doesn't exist, unless the webapp is running directly
>>>> from a .war file.
>>>> Note that, if specified, the value is an absolute path, not
>>>> relative to the webapp. -->
>>>> <context-param>
>>>> <param-name>log4j-log-home</param-name>
>>>> <param-value>/usr/local/logs/tomcat</param-value>
>>>> </context-param>
>>>>
>>>>
>>>>Try that out and let me know if you still have any concerns.
>>>>
>>>>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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>>>>>>><ma...@jakarta.apache.org>
>>>>>>>>CB> For additional commands, e-mail:
>>>>>>>><ma...@jakarta.apache.org>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>-- Best regards,
>>>>>>>>Jacob mailto:hoju@visi.com
>>>>>>>>
>>>>>>>>
>>>>>>>>--
>>>>>>>>To unsubscribe, e-mail:
>>>>>>>><ma...@jakarta.apache.org>
>>>>>>>>For additional commands, e-mail:
>>>>>>>><ma...@jakarta.apache.org>
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>To unsubscribe, e-mail:
>>>>>>><ma...@jakarta.apache.org>
>>>>>>>For additional commands, e-mail:
>>>>>>><ma...@jakarta.apache.org>
>>>>>
>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>>>For additional commands, e-mail:
>>>>><ma...@jakarta.apache.org>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Carey Boldenow <c....@cyterasystems.com>.
Hi Jake,
I did remove the DOCTYPE from my xml document and
everything worked just fine. Thanks again for all your
help on this.
Regards,
Carey
On Wed, 15 Jan 2003 13:41:14 -0600
Jacob Kjome <ho...@visi.com> wrote:
>
>Hi Carey,
>
>Note that a couple updates were made since log4j-1.2.7
>was released. The changes were to DomConfigurator and
>Log4jEntityResolver. See...
>
>http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/src/java/org/apache/log4j/xml/Attic/Log4jEntityResolver.java?rev=1.1.2.2&only_with_tag=v1_2-branch&content-type=text/vnd.viewcvs-markup
>
>http://cvs.apache.org/viewcvs/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java?rev=1.49.2.3&only_with_tag=v1_2-branch&content-type=text/vnd.viewcvs-markup
>
>I'm not sure that will, for sure, solve your issue, but
>it certainly solved the log4j.jar file locking issue.
>
>The other thing you can do is try removing the doctype
>from log4j.xml altogether and see if that works. Based
>on a report from a Barracuda user, that solved the issue
>for him when he was serving his app directly from a .war
>file under Tomcat.
>
>Jake
>
>
>At 11:13 AM 1/15/2003 -0800, you wrote:
>>Well here is the latest. I am able to create an
>>InputStream object of my log4jProps.xml directly from the
>>.war file in WebLogic. However, the log4j.dtd file cannot
>>be located (see stacktrace below). I incorporated the
>>Log4jEntityResolver into my code (see below), but that
>>did not seem to have any impact at all. I am using the
>>standard DOCTYPE declaration in my xml file. Any help is
>>greatly appreciated.
>>
>>Regards,
>>Carey
>>
>>
>>[ChangeAwareClassLoader] : Name is :
>>org/apache/crimson/parser/resources/Message
>>s_en.properties
>>[ChangeAwareClassLoader] : Name is :
>>org/apache/crimson/parser/resources/Message
>>s_en_US.properties
>>org.xml.sax.SAXParseException: Relative URI "log4j.dtd";
>>can not be resolved wit
>>hout a base URI.
>> at
>>org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
>> at
>>org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
>> at
>>org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
>> at
>>org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
>> at
>>org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
>>
>> at
>>org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
>> at
>>org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
>> at
>>org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
>>
>> at
>>org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
>>.java:185)
>> at
>>javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
>> at
>>com.cytera.frameworks.common.LogManager.init(LogManager.java:49)
>> at
>>ServerConfigurator.init(ServerConfigurator.java:76)
>> at
>>weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
>>pl.java:713)
>> at
>>weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
>>
>>public static void init(String level, InputStream in) {
>> DocumentBuilderFactory dbfactory =
>>DocumentBuilderFactory.newInstance();
>> dbfactory.setNamespaceAware(true);
>> try {
>> DocumentBuilder dbuilder =
>>dbfactory.newDocumentBuilder();
>> dbuilder.setEntityResolver(new
>>Log4jEntityResolver());
>>
>>DOMConfigurator.configure(dbuilder.parse(in).getDocumentElement());
>> }
>> catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>>
>>
>>On Wed, 15 Jan 2003 01:03:50 -0600
>> Jacob Kjome <ho...@visi.com> wrote:
>>>
>>>Ug,
>>>
>>>Upon further examination of my code, it turns out I knew
>>>what I was doing after all. If you set the
>>>"log4j-log-home" context parameter in web.xml (currently
>>>commented out because it is an optional parameter which
>>>will always be system specific if supplied), then you
>>>*can* set the system property to your custom path, even
>>>in the case of serving your webapp out of a .war file.
>>>Not sure why I missed that before? I guess I can't read
>>>my own code :-(
>>>
>>>See line 108 of the Log4jApplicationWatch.java file to
>>>see where I am talking about. You just need to make sure
>>>to uncomment and set the path in the web.xml. For
>>>instance...
>>>
>>><!-- optional param for use with a File Appender.
>>> Specifies a path to be read from a log4j xml
>>> config file as a system property. The
>>>property name is
>>> dynamically generated and takes on the
>>>following pattern:
>>> [webapp name].log.home
>>> In Barracuda's case, it would be
>>>"Barracuda.log.home".
>>> The path defaults to WEB-INF/logs directory,
>>>which is created
>>> if it doesn't exist, unless the webapp is
>>>running directly
>>> from a .war file.
>>> Note that, if specified, the value is an
>>>absolute path, not
>>> relative to the webapp. -->
>>> <context-param>
>>> <param-name>log4j-log-home</param-name>
>>> <param-value>/usr/local/logs/tomcat</param-value>
>>> </context-param>
>>>
>>>
>>>Try that out and let me know if you still have any
>>>concerns.
>>>
>>>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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>>>>>><ma...@jakarta.apache.org>
>>>>>>>CB> For additional commands, e-mail:
>>>>>>><ma...@jakarta.apache.org>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>-- Best regards,
>>>>>>>Jacob mailto:hoju@visi.com
>>>>>>>
>>>>>>>
>>>>>>>--
>>>>>>>To unsubscribe, e-mail:
>>>>>>><ma...@jakarta.apache.org>
>>>>>>>For additional commands, e-mail:
>>>>>>><ma...@jakarta.apache.org>
>>>>>>
>>>>>>
>>>>>>--
>>>>>>To unsubscribe, e-mail:
>>>>>><ma...@jakarta.apache.org>
>>>>>>For additional commands, e-mail:
>>>>>><ma...@jakarta.apache.org>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>>For additional commands, e-mail:
>>>><ma...@jakarta.apache.org>
>>
>>
>>--
>>To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
Hi Carey,
Note that a couple updates were made since log4j-1.2.7 was released. The
changes were to DomConfigurator and Log4jEntityResolver. See...
http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/src/java/org/apache/log4j/xml/Attic/Log4jEntityResolver.java?rev=1.1.2.2&only_with_tag=v1_2-branch&content-type=text/vnd.viewcvs-markup
http://cvs.apache.org/viewcvs/jakarta-log4j/src/java/org/apache/log4j/xml/DOMConfigurator.java?rev=1.49.2.3&only_with_tag=v1_2-branch&content-type=text/vnd.viewcvs-markup
I'm not sure that will, for sure, solve your issue, but it certainly solved
the log4j.jar file locking issue.
The other thing you can do is try removing the doctype from log4j.xml
altogether and see if that works. Based on a report from a Barracuda user,
that solved the issue for him when he was serving his app directly from a
.war file under Tomcat.
Jake
At 11:13 AM 1/15/2003 -0800, you wrote:
>Well here is the latest. I am able to create an InputStream object of my
>log4jProps.xml directly from the .war file in WebLogic. However, the
>log4j.dtd file cannot be located (see stacktrace below). I incorporated
>the Log4jEntityResolver into my code (see below), but that did not seem to
>have any impact at all. I am using the standard DOCTYPE declaration in my
>xml file. Any help is greatly appreciated.
>
>Regards,
>Carey
>
>
>[ChangeAwareClassLoader] : Name is :
>org/apache/crimson/parser/resources/Message
>s_en.properties
>[ChangeAwareClassLoader] : Name is :
>org/apache/crimson/parser/resources/Message
>s_en_US.properties
>org.xml.sax.SAXParseException: Relative URI "log4j.dtd"; can not be
>resolved wit
>hout a base URI.
> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
> at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
> at org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
> at
> org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
> at
> org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
>
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
> at
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
>
> at
> org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
>.java:185)
> at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
> at com.cytera.frameworks.common.LogManager.init(LogManager.java:49)
> at ServerConfigurator.init(ServerConfigurator.java:76)
> at
> weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
>pl.java:713)
> at
> weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
>
>public static void init(String level, InputStream in) {
> DocumentBuilderFactory dbfactory =
> DocumentBuilderFactory.newInstance();
> dbfactory.setNamespaceAware(true);
> try {
> DocumentBuilder dbuilder = dbfactory.newDocumentBuilder();
> dbuilder.setEntityResolver(new Log4jEntityResolver());
>
>DOMConfigurator.configure(dbuilder.parse(in).getDocumentElement());
> }
> catch (Exception e) {
> e.printStackTrace();
> }
> }
>
>
>On Wed, 15 Jan 2003 01:03:50 -0600
> Jacob Kjome <ho...@visi.com> wrote:
>>
>>Ug,
>>
>>Upon further examination of my code, it turns out I knew what I was doing
>>after all. If you set the "log4j-log-home" context parameter in web.xml
>>(currently commented out because it is an optional parameter which will
>>always be system specific if supplied), then you *can* set the system
>>property to your custom path, even in the case of serving your webapp out
>>of a .war file. Not sure why I missed that before? I guess I can't read
>>my own code :-(
>>
>>See line 108 of the Log4jApplicationWatch.java file to see where I am
>>talking about. You just need to make sure to uncomment and set the path
>>in the web.xml. For instance...
>>
>><!-- optional param for use with a File Appender.
>> Specifies a path to be read from a log4j xml
>> config file as a system property. The property name is
>> dynamically generated and takes on the following pattern:
>> [webapp name].log.home
>> In Barracuda's case, it would be "Barracuda.log.home".
>> The path defaults to WEB-INF/logs directory, which is created
>> if it doesn't exist, unless the webapp is running directly
>> from a .war file.
>> Note that, if specified, the value is an absolute path, not
>> relative to the webapp. -->
>> <context-param>
>> <param-name>log4j-log-home</param-name>
>> <param-value>/usr/local/logs/tomcat</param-value>
>> </context-param>
>>
>>
>>Try that out and let me know if you still have any concerns.
>>
>>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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>>>>><ma...@jakarta.apache.org>
>>>>>>CB> For additional commands, e-mail:
>>>>>><ma...@jakarta.apache.org>
>>>>>>
>>>>>>
>>>>>>
>>>>>>-- Best regards,
>>>>>>Jacob mailto:hoju@visi.com
>>>>>>
>>>>>>
>>>>>>--
>>>>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>>>>For additional commands, e-mail:
>>>>>><ma...@jakarta.apache.org>
>>>>>
>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>>>For additional commands, e-mail:
>>>>><ma...@jakarta.apache.org>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Carey Boldenow <c....@cyterasystems.com>.
Well here is the latest. I am able to create an
InputStream object of my log4jProps.xml directly from the
.war file in WebLogic. However, the log4j.dtd file cannot
be located (see stacktrace below). I incorporated the
Log4jEntityResolver into my code (see below), but that did
not seem to have any impact at all. I am using the
standard DOCTYPE declaration in my xml file. Any help is
greatly appreciated.
Regards,
Carey
[ChangeAwareClassLoader] : Name is :
org/apache/crimson/parser/resources/Message
s_en.properties
[ChangeAwareClassLoader] : Name is :
org/apache/crimson/parser/resources/Message
s_en_US.properties
org.xml.sax.SAXParseException: Relative URI "log4j.dtd";
can not be resolved wit
hout a base URI.
at
org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
at
org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
at
org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
at
org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
at
org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
at
org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at
org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl
.java:185)
at
javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
at
com.cytera.frameworks.common.LogManager.init(LogManager.java:49)
at
ServerConfigurator.init(ServerConfigurator.java:76)
at
weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:713)
at
weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
public static void init(String level, InputStream in) {
DocumentBuilderFactory dbfactory =
DocumentBuilderFactory.newInstance();
dbfactory.setNamespaceAware(true);
try {
DocumentBuilder dbuilder =
dbfactory.newDocumentBuilder();
dbuilder.setEntityResolver(new
Log4jEntityResolver());
DOMConfigurator.configure(dbuilder.parse(in).getDocumentElement());
}
catch (Exception e) {
e.printStackTrace();
}
}
On Wed, 15 Jan 2003 01:03:50 -0600
Jacob Kjome <ho...@visi.com> wrote:
>
>Ug,
>
>Upon further examination of my code, it turns out I knew
>what I was doing after all. If you set the
>"log4j-log-home" context parameter in web.xml (currently
>commented out because it is an optional parameter which
>will always be system specific if supplied), then you
>*can* set the system property to your custom path, even
>in the case of serving your webapp out of a .war file.
> Not sure why I missed that before? I guess I can't read
>my own code :-(
>
>See line 108 of the Log4jApplicationWatch.java file to
>see where I am talking about. You just need to make sure
>to uncomment and set the path in the web.xml. For
>instance...
>
><!-- optional param for use with a File Appender.
> Specifies a path to be read from a log4j
>xml
> config file as a system property. The
>property name is
> dynamically generated and takes on the
>following pattern:
> [webapp name].log.home
> In Barracuda's case, it would be
>"Barracuda.log.home".
> The path defaults to WEB-INF/logs
>directory, which is created
> if it doesn't exist, unless the webapp is
>running directly
> from a .war file.
> Note that, if specified, the value is an
>absolute path, not
> relative to the webapp. -->
> <context-param>
> <param-name>log4j-log-home</param-name>
> <param-value>/usr/local/logs/tomcat</param-value>
> </context-param>
>
>
>Try that out and let me know if you still have any
>concerns.
>
>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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>>>><ma...@jakarta.apache.org>
>>>>>CB> For additional commands, e-mail:
>>>>><ma...@jakarta.apache.org>
>>>>>
>>>>>
>>>>>
>>>>>-- Best regards,
>>>>>Jacob mailto:hoju@visi.com
>>>>>
>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail:
>>>>><ma...@jakarta.apache.org>
>>>>>For additional commands, e-mail:
>>>>><ma...@jakarta.apache.org>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>>For additional commands, e-mail:
>>>><ma...@jakarta.apache.org>
>>
>>
>>--
>>To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
Ug,
Upon further examination of my code, it turns out I knew what I was doing
after all. If you set the "log4j-log-home" context parameter in web.xml
(currently commented out because it is an optional parameter which will
always be system specific if supplied), then you *can* set the system
property to your custom path, even in the case of serving your webapp out
of a .war file. Not sure why I missed that before? I guess I can't read
my own code :-(
See line 108 of the Log4jApplicationWatch.java file to see where I am
talking about. You just need to make sure to uncomment and set the path in
the web.xml. For instance...
<!-- optional param for use with a File Appender.
Specifies a path to be read from a log4j xml
config file as a system property. The property name is
dynamically generated and takes on the following pattern:
[webapp name].log.home
In Barracuda's case, it would be "Barracuda.log.home".
The path defaults to WEB-INF/logs directory, which is created
if it doesn't exist, unless the webapp is running directly
from a .war file.
Note that, if specified, the value is an absolute path, not
relative to the webapp. -->
<context-param>
<param-name>log4j-log-home</param-name>
<param-value>/usr/local/logs/tomcat</param-value>
</context-param>
Try that out and let me know if you still have any concerns.
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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>>><ma...@jakarta.apache.org>
>>>>CB> For additional commands, e-mail:
>>>><ma...@jakarta.apache.org>
>>>>
>>>>
>>>>
>>>>-- Best regards,
>>>>Jacob mailto:hoju@visi.com
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>>><ma...@jakarta.apache.org>
>>>>CB> For additional commands, e-mail:
>>>><ma...@jakarta.apache.org>
>>>>
>>>>
>>>>
>>>>-- Best regards,
>>>>Jacob mailto:hoju@visi.com
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Carey Boldenow <c....@cyterasystems.com>.
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 <ho...@visi.com> 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 <ho...@visi.com> 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:
>>> <ma...@jakarta.apache.org>
>>>CB> For additional commands, e-mail:
>>><ma...@jakarta.apache.org>
>>>
>>>
>>>
>>>-- Best regards,
>>> Jacob mailto:hoju@visi.com
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>>For additional commands, e-mail:
>>><ma...@jakarta.apache.org>
>>
>>
>>--
>>To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
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 <ho...@visi.com> 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: <ma...@jakarta.apache.org>
>>CB> For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>
>>
>>-- Best regards,
>> Jacob mailto:hoju@visi.com
>>
>>
>>--
>>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Carey Boldenow <c....@cyterasystems.com>.
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 <ho...@visi.com> 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:
> <ma...@jakarta.apache.org>
>CB> For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>
>
>--
>Best regards,
> Jacob mailto:hoju@visi.com
>
>
>--
>To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: accessing xml properties in war file
Posted by Jacob Kjome <ho...@visi.com>.
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: <ma...@jakarta.apache.org>
CB> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Best regards,
Jacob mailto:hoju@visi.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>