You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by sk k <sk...@yahoo.com> on 2003/01/30 22:24:28 UTC
DOMConfigurator issues
Hi,
I am having problem writing a xml config file for
log4j. Like I need to subsitute -D option values into
xml config file.
Eg: java -Dlogdir=C:/java TestLogger
Substituting the logdir value into log4j.xml as shown
below(shown by an arrow).
log4j.xml
---------
<appender name="dest2"
class="org.apache.log4j.RollingFileAppender">
<param name="MaxFileSize" value="1MB"/>
<param name="MaxBackupIndex" value="2"/>
<param name="File"
value="${logdir}/log/test/xml_testsamp.log"/> <---
<param name="Threshold" value="DEBUG"/>
<layout class="org.apache.log4j.TTCCLayout"/>
</appender>
Can somebody pls let me know if DOMConfigurator
supports substituting values into log4j.xml file that
were passed as -D option.
I really don't want to do the substitution based on
environment values.
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org
Re: DOMConfigurator issues
Posted by sk k <sk...@yahoo.com>.
Yes it is indeed working. I am not sure why it didn't work when I was testing. Thanks for replying back.Anyway, I have another problem wherenin I need to put the logdir value in an xml file and source it into log4j.xml rather than get it from -D option.Eg:- I have two files log4j.xml and test.xml file Sample Contents of test.xml file are shown below.test.xml ----------Sample Contents of test.xml file are shown below.log4j.xml--------
where XXXX should hold the value of logdir tag. Is there anyway we can source one xml file into another file.Pls let me know. Thanks again.--- Ceki G�lc� wrote:> > "java -Dlogdir=C:/java TestLogger" should work with> DOMConfigurator. What > goes wrong?> > At 13:24 30.01.2003 -0800, you wrote:> >Hi,> >> >I am having problem writing a xml config file for> >log4j. Like I need to subsitute -D option values> into> >xml config file.> >> >Eg: java -Dlogdir=C:/java TestLogger> >> >Substituting the logdir value into log4j.xml as> shown> >below(shown by an arrow).> >> >log4j.xml> >---------> > >class="org.apache.log4j.RollingFileAppender">> >
> >
> >
>value="${logdir}/log/test/xml_testsamp.log"/> > >
> > > > > >> >> >Can somebody pls let me know if DOMConfigurator> >supports substituting values into log4j.xml file> that> >were passed as -D option.> >> >I really don't want to do the substitution based on> >environment values.> >> >> >> >> >__________________________________________________> >Do you Yahoo!?> >Yahoo! Mail Plus - Powerful. Affordable. Sign up> now.> >http://mailplus.yahoo.com> >> >---------------------------------------------------------------------> >To unsubscribe, e-mail:> log4j-user-unsubscribe@jakarta.apache.org> >For additional commands, e-mail:> log4j-user-help@jakarta.apache.org> > --> Ceki> > > > ---------------------------------------------------------------------> To unsubscribe, e-mail:> log4j-user-unsubscribe@jakarta.apache.org> For additional commands, e-mail:> log4j-user-help@jakarta.apache.org>
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: DOMConfigurator issues
Posted by Ceki Gülcü <ce...@qos.ch>.
"java -Dlogdir=C:/java TestLogger" should work with DOMConfigurator. What
goes wrong?
At 13:24 30.01.2003 -0800, you wrote:
>Hi,
>
>I am having problem writing a xml config file for
>log4j. Like I need to subsitute -D option values into
>xml config file.
>
>Eg: java -Dlogdir=C:/java TestLogger
>
>Substituting the logdir value into log4j.xml as shown
>below(shown by an arrow).
>
>log4j.xml
>---------
> <appender name="dest2"
>class="org.apache.log4j.RollingFileAppender">
> <param name="MaxFileSize" value="1MB"/>
> <param name="MaxBackupIndex" value="2"/>
> <param name="File"
>value="${logdir}/log/test/xml_testsamp.log"/> <---
> <param name="Threshold" value="DEBUG"/>
> <layout class="org.apache.log4j.TTCCLayout"/>
> </appender>
>
>
>Can somebody pls let me know if DOMConfigurator
>supports substituting values into log4j.xml file that
>were passed as -D option.
>
>I really don't want to do the substitution based on
>environment values.
>
>
>
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
--
Ceki
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org