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

Jitin Dominic commented on LOG4J2-3381:
---------------------------------------

[~ggregory] 

I added the above mentioned repository URL and also following dependencies:
{code:java}
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: 
'2.17.2-SNAPSHOT'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: 
'2.17.2-SNAPSHOT'
compile group: 'org.apache.logging.log4j', name: 'log4j-1.2-api', version: 
'2.17.2-SNAPSHOT'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: 
'2.17.2-SNAPSHOT' {code}
No logs were displayed.

Earlier I was able to get the error logs, but using the SNAPSHOT versions, I 
didn't get any of the logs.

 

 I'm using _log4j2.properties_ file and using following code:
{code:java}
InputStream keyStream = 
ClassLoader.getSystemResourceAsStream(PATH_TO_CONFIG_FILE)
PropertyConfigurator.configure(keyStream) {code}
Do I need to add any configuration?

> Programmatically configuring Log4j2
> -----------------------------------
>
>                 Key: LOG4J2-3381
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3381
>             Project: Log4j 2
>          Issue Type: Question
>            Reporter: Jitin Dominic
>            Priority: Major
>
> During upgrading log4j2 in grails 2.5.4 application, I removed all log4j 
> 1.2.17 dependencies and added following dependencies pertaining to v2.17.1:
>  * log4j-api
>  * log4j-core
>  * log4j-1.2-api
>  * log4j-slf4j-impl
>  
> I'm trying to read my _log4j2.properties_ file programmatically. We are using 
> PropertyConfigurator.configure() to configure the logger. 
>  
> But I noticed in the 
> [documentation|https://logging.apache.org/log4j/2.x/manual/migration.html] 
> that Log4j 1.x bridge has some limitations and we can't use it for 
> programmatic configuration. 
> Is there any alternative way to configure logger programmatically without 
> using PropertyConfigurator?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to