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 "Ralph Goers (JIRA)" <ji...@apache.org> on 2016/07/20 03:42:20 UTC

[jira] [Comment Edited] (LOG4J2-1470) Add convenience API Configurator.initializeResource(String, ClassLoader, String)

    [ https://issues.apache.org/jira/browse/LOG4J2-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15385267#comment-15385267 ] 

Ralph Goers edited comment on LOG4J2-1470 at 7/20/16 3:42 AM:
--------------------------------------------------------------

What is the difference between that and 
{code}
final LoggerContext = Configurator.initialize("SomeName", classLoader, "path/to/a/log4j2-config.xml", null);
{code}
?

IOW, why not just add
{code}
public LoggerContext initialize(final String name, final ClassLoader loader, final String configLocation) {
    return initialize(name, loader, configLocation, null);
}
{code}


was (Author: ralph.goers@dslextreme.com):
What is the difference between that and 
{code}
final LoggerContext = Configurator.initialize("SomeName", classLoader, "path/to/a/log4j2-config.xml", null);
{code}
?

> Add convenience API Configurator.initializeResource(String, ClassLoader, String)
> --------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1470
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1470
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Configurators
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>             Fix For: 2.7
>
>
> Add convenience API with error checking to replace:
> {code:java}
> final URL url = classLoader.getResource("path/to/a/log4j2-config.xml");
> final LoggerContext context = Configurator.initialize("SomeName", classLoader, url.toURI());
> {code}
> with:
> {code:java}
> final LoggerContext context = Configurator.initializeResource("SomeName", classLoader, "path/to/a/log4j2-config.xml");
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org