Hello Luigi,
There is a problem at this line: l.getContext().start(cfg);Logger cannot
contain any method named getContext. What can we use insead?
Zafer AYDIN
> From: luigi.al...@persis.de
> To: log4j-user@logging.apache.org
> Subject: AW: how to set log4j2 xml config location
> Date: Tue, 13 M
Minor improvement: you can replace:
LogManager.getLogger(LogManager.ROOT_LOGGER_NAME)
with:
LogManager.getRootLogger()
Gary
On Tue, May 13, 2014 at 4:15 AM, Luigi Alice wrote:
> Load the file via InputStream:
>
> final ConfigurationFactory.ConfigurationSource source
> =
While this works it would be better to use the Configurator class such as
Configurator.intitalize(“MyContextName”, “myLog4j2.xml”);
or
final ConfigurationFactory.ConfigurationSource source = new
ConfigurationFactory.ConfigurationSource(new
ByteArrayInputStream(config.getBytes("UTF-8")));
Conf
Yes, it has.
Class:
org.apache.logging.log4j.core.Logger
-Ursprüngliche Nachricht-
Von: zafer aydin [mailto:zafera...@hotmail.com]
Gesendet: Dienstag, 13. Mai 2014 13:36
An: Log4J Users List
Betreff: RE: AW: how to set log4j2 xml config location
Hello Luigi,
There is a problem at thi
It works,Thank you.
Zafer AYDIN
> From: luigi.al...@persis.de
> To: log4j-user@logging.apache.org
> Subject: AW: AW: how to set log4j2 xml config location
> Date: Tue, 13 May 2014 11:47:31 +
>
> Yes, it has.
>
> Class:
> org.apache.logging.log4j.core.Logger
>
>
>
> -Ursprüngliche Na
Take a look here:
http://logging.apache.org/log4j/2.x/faq.html#config_location
On Tue, May 13, 2014 at 2:20 PM, zafer aydin wrote:
> Hello,
> In my Java application, I created an xml configuration file named
> "log4j2.xml" and put it under "Default Package". It works as expected.Now I
> want to
Load the file via InputStream:
final ConfigurationFactory.ConfigurationSource source = new
ConfigurationFactory.ConfigurationSource(new
ByteArrayInputStream(config.getBytes("UTF-8")));
XMLConfiguration cfg = new XMLConfiguration(source);