Thanks for the prompt reply. This is what i did
<?xml version="1.0" encoding="UTF-8" ?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!DOCTYPE log4j:configuration [<!ENTITY logpath
"/home/stan/logfiles/presenceClient.txt">]>
<!-- Presence Appender-->
<appender name="presenceClientFileAppender"
class="org.apache.log4j.RollingFileAppender">
<layout class="org.apache.log4j.PatternLayout">
</layout>
</appender>
and this i the error i got
log4cxx: Error parsing file [/home/stan/datafiles/mugsim/LogConfig.xml],
Internal errorXML parser error code: not well-formed (invalid token) (4)
carnold-3 wrote:
>
> You could use an XML internal entity for that:
>
> <!DOCTYPE log4j:configuration [
> <!ENTITY myvariable 'somevalue''>
> ]>
> <log4j:configuration>
> <logger name="&myvariable;">
> </logger>
> </log4:configuration>
>
>
> See http://www.xml.com/pub/a/98/08/xmlqna2.html, the XML spec or any
> number of other resources.
>
> On Dec 14, 2010, at 7:49 AM, stan.forums wrote:
>
>>
>> Hi all,
>>
>> I wish to declare a local variable inside my xml configuration file, and
>> then later on i wish to access that variable. The reason being that i
>> declare many appenders in one config file. When i wish to change the path
>> to
>> the log file in the appender, idon't want to have to edit each appender
>> separately, i would like to have a declared logpath variable at the top
>> of
>> the config file and then just have to edit that one variable definition
>> and
>> then all of the appenders will have the correct new path automagically.
>>
>> thanks
>> --
>> View this message in context:
>> http://old.nabble.com/Local-variable-in-XML-configuration-file-tp30454810p30454810.html
>> Sent from the Log4cxx - Users mailing list archive at Nabble.com.
>>
>
>
>
--
View this message in context:
http://old.nabble.com/Local-variable-in-XML-configuration-file-tp30454810p30471541.html
Sent from the Log4cxx - Users mailing list archive at Nabble.com.