java - How to set value in log4j.xml using property file? -
I would like to know whether log4j.xml is likely to set up an attribute using the property file. For example, log4j.xml:
& lt ;? XML version = "1.0" encoding = "ISO-885 9-1"? & Gt; & Lt ;! DOCTYPE log4j: Configuration system "log4j.dtd" & gt; & Lt; Log4j: Configuration & gt; & Lt; Appender Name = "console" class = "org.apache.log4j.ConsoleAppender" & gt; & Lt; Param name = "target" value = "System.out" /> & Lt; Layout class = "org.apache.log4j.PatternLayout" & gt; & Lt; param name = "ConversionPattern" value = "% d {ISO8601}% -5p [% c {1}] -% l -% m% n" / & gt; & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt; Appender name = "FILE" class = "org.apache.log4j.FileAppender" & gt; & Lt; Param name = "file" value = "\ D: \ ReadText_File \ log4jlogss.txt" /> & Lt; Param name = "add" value = "true" /> & Lt; Layout class = "org.apache.log4j.PatternLayout" & gt; & Lt; param name = "ConversionPattern" value = "% d {ISO8601}% -5p [% c {1}] -% l -% m% n" / & gt; & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt; Logger name = "org.apache" & gt; & Lt; Level value = "WARN" /> & Lt; / Logger & gt; & Lt; Root & gt; & Lt; Level value = "DEBUG" /> & Lt; Epander-Reef Ref = "FILE" /> & Lt; Append-riff ref = "console" /> & Lt; / Root & gt; & Lt; / Log4j: Configuration & gt; I want to specify the path to the file using the property file, any ideas how can we do it ????
Regarding log-ins, this type of configuration that is XML configuration which is the property Embeds the file, is not supported in the current version.
For details, you can use the source code of log4j. XML Pars Details Class Dome Configurator. Is configured in
Comments
Post a Comment