You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Remko Popma (JIRA)" <ji...@apache.org> on 2017/06/01 08:20:04 UTC

[jira] [Comment Edited] (LOG4J2-1926) Remove dependency on MarshalledObject from log4j-api

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

Remko Popma edited comment on LOG4J2-1926 at 6/1/17 8:19 AM:
-------------------------------------------------------------

Ah, thanks. I see it now. 
That one is trickier as it gets information from the platform MBeans we can't get elsewhere. 

Not sure how to go about this one. Use reflection to avoid compile time dependency on java.lang.management? Then at runtime it would simply provide less information on Android. This would work but has the usual drawbacks of using reflection. 

Does anyone have ideas for a different approach?


was (Author: remkop@yahoo.com):
Ah, thanks. I see it now. 
That one is trickier as it gets information from the platform MBeans we can't get elsewhere. 

Not sure how to go about this one. Use reflection to avoid compile time dependency on java.lang.management? Then at runtime it would simply provide less information on Android. 

> Remove dependency on MarshalledObject from log4j-api
> ----------------------------------------------------
>
>                 Key: LOG4J2-1926
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1926
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: 2.8
>         Environment: Android
>            Reporter: Oleg Kalnichevski
>            Assignee: Remko Popma
>
> (Remko: Paraphrasing discussion on the log4j dev mailing list. Please feel free to update/modify):
> When the Apache HttpClient 5.0 library gets pulled into an Android project, the Lint static code analyzer reports two severe violations due to transitive dependency through Log4j APIs 2.8 on Java RMI and Java Management APIs.
> At the moment adding a transitive dependency on log4j2-api causes any Android build to fail with a scary invalid package error. Surely this error can be ignored with a custom lint rule but it may present a certain reason for concert to less experienced developers.
> This is caused by Log4j's use of MarshalledObject: User domain objects and exceptions are wrapped in MarshalledObject when LogEvents are serialized. This allows applications like Lilith to deserialize LogEvents even when not all domain classes are on the classpath (LOG4J2-1226).
> Consider finding a different way to solve this problem that does not require MarshalledObject.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)