[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-09-24 Thread Kirk Lund (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16937213#comment-16937213
 ] 

Kirk Lund commented on GEODE-7050:
--

It may be possible to work around this bug in previous versions if you exclude 
{{log4j-core}} from the classpath and dependencies.

> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
> Fix For: 1.9.1, 1.10.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-20 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16911674#comment-16911674
 ] 

ASF subversion and git services commented on GEODE-7050:


Commit 50b31715355f65b61fd5a6f14dcad942f46afcfe in geode's branch 
refs/heads/release/1.9.1 from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=50b3171 ]

GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider (#3892)

* GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j Core uses SLF4JProvider when log4j-to-slf4j is in
the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attemping to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

* Update 
geode-core/src/test/java/org/apache/geode/internal/logging/DefaultProviderCheckerTest.java

Co-Authored-By: Aaron Lindsey 
(cherry picked from commit e5c9c420f462149fd062847904e3435fbe99afb4)


> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
> Fix For: 1.10.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-20 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16911673#comment-16911673
 ] 

ASF subversion and git services commented on GEODE-7050:


Commit 50b31715355f65b61fd5a6f14dcad942f46afcfe in geode's branch 
refs/heads/release/1.9.1 from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=50b3171 ]

GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider (#3892)

* GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j Core uses SLF4JProvider when log4j-to-slf4j is in
the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attemping to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

* Update 
geode-core/src/test/java/org/apache/geode/internal/logging/DefaultProviderCheckerTest.java

Co-Authored-By: Aaron Lindsey 
(cherry picked from commit e5c9c420f462149fd062847904e3435fbe99afb4)


> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
> Fix For: 1.10.0
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-08 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16903471#comment-16903471
 ] 

ASF subversion and git services commented on GEODE-7050:


Commit e25f2e8ec11e167380f542920b867eca9647a396 in geode's branch 
refs/heads/release/1.10.0 from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=e25f2e8 ]

GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider (#3892)

* GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j Core uses SLF4JProvider when log4j-to-slf4j is in
the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attemping to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

* Update 
geode-core/src/test/java/org/apache/geode/internal/logging/DefaultProviderCheckerTest.java

Co-Authored-By: Aaron Lindsey 
(cherry picked from commit e5c9c420f462149fd062847904e3435fbe99afb4)


> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-08 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16903470#comment-16903470
 ] 

ASF subversion and git services commented on GEODE-7050:


Commit e5c9c420f462149fd062847904e3435fbe99afb4 in geode's branch 
refs/heads/develop from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=e5c9c42 ]

GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider (#3892)

* GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j Core uses SLF4JProvider when log4j-to-slf4j is in
the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attemping to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

* Update 
geode-core/src/test/java/org/apache/geode/internal/logging/DefaultProviderCheckerTest.java

Co-Authored-By: Aaron Lindsey 


> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-08 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16903472#comment-16903472
 ] 

ASF subversion and git services commented on GEODE-7050:


Commit e25f2e8ec11e167380f542920b867eca9647a396 in geode's branch 
refs/heads/release/1.10.0 from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=e25f2e8 ]

GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider (#3892)

* GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j Core uses SLF4JProvider when log4j-to-slf4j is in
the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attemping to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

* Update 
geode-core/src/test/java/org/apache/geode/internal/logging/DefaultProviderCheckerTest.java

Co-Authored-By: Aaron Lindsey 
(cherry picked from commit e5c9c420f462149fd062847904e3435fbe99afb4)


> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-08 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16903469#comment-16903469
 ] 

ASF subversion and git services commented on GEODE-7050:


Commit e5c9c420f462149fd062847904e3435fbe99afb4 in geode's branch 
refs/heads/develop from Kirk Lund
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=e5c9c42 ]

GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider (#3892)

* GEODE-7050: Use Log4jAgent only if Log4j is using Log4jProvider

This change prevents Geode from using Log4jAgent if Log4j Core is
present but not using Log4jProvider.

For example, Log4j Core uses SLF4JProvider when log4j-to-slf4j is in
the classpath.

By disabling Log4jAgent when other Log4j Providers are in use, this
prevents problems such as ClassCastExceptions when attemping to cast
loggers from org.apache.logging.slf4j.SLF4JLogger to
org.apache.logging.log4j.core.Logger to get the LoggerConfig or
LoggerContext.

* Update 
geode-core/src/test/java/org/apache/geode/internal/logging/DefaultProviderCheckerTest.java

Co-Authored-By: Aaron Lindsey 


> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-07 Thread Kirk Lund (JIRA)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16902546#comment-16902546
 ] 

Kirk Lund commented on GEODE-7050:
--

The environment that produced this failure stack seems to include logback, 
log4j-core, and log4j-to-slf4j. The latter will install `SLF4JProvider` for 
log4j. 

Geode's logging `ProviderAgentLoader.DefaultProvider` incorrectly assumes that 
log4j-core's `Log4jProvider` is installed because it can class load 
`org.apache.logging.log4j.core.Logger`. If `SLF4JProvider` is also present then 
log4j will prefer it over `Log4jProvider`.

> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0, 1.10.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (GEODE-7050) Log4jAgent should avoid casting non-log4j loggers

2019-08-06 Thread Kirk Lund (JIRA)


[ 
https://issues.apache.org/jira/browse/GEODE-7050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16901304#comment-16901304
 ] 

Kirk Lund commented on GEODE-7050:
--

Notes on fixing this ticket:
* Log4jAgent probably needs to check logger class before casting it

> Log4jAgent should avoid casting non-log4j loggers
> -
>
> Key: GEODE-7050
> URL: https://issues.apache.org/jira/browse/GEODE-7050
> Project: Geode
>  Issue Type: Bug
>  Components: logging
>Affects Versions: 1.9.0
>Reporter: Kirk Lund
>Assignee: Kirk Lund
>Priority: Major
>
> Users should be able to use SLF4J API with Geode even when log4j-core is in 
> the class path and the Geode log4j appenders are being used.
> Log4jAgent assumes that all Loggers are Log4J loggers. This can result in a 
> ClassCastException when encountering an instance of SLF4JLogger.
> {noformat}
> Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger 
> cannot be cast to org.apache.logging.log4j.core.Logger
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getRootLoggerContext(Log4jAgent.java:91)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.getConfiguration(Log4jAgent.java:95)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.isUsingGemFireDefaultConfig(Log4jAgent.java:80)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.shouldUpdateLogLevels(Log4jAgent.java:129)
>   at 
> org.apache.geode.internal.logging.log4j.Log4jAgent.configure(Log4jAgent.java:107)
>   at 
> org.apache.geode.internal.logging.Configuration.configChanged(Configuration.java:152)
>   at 
> org.apache.geode.internal.logging.Configuration.initialize(Configuration.java:141)
>   at 
> org.apache.geode.internal.logging.LoggingSession.createSession(LoggingSession.java:65)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:762)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:446)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:432)
>   at 
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:257)
>   at 
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:164)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:243)
>   at 
> org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:214)
>   at 
> org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:391)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.resolveCache(CacheFactoryBean.java:325)
>   at 
> org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:269)
>   ... 107 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)