Re: [D] Using Custom ClassLoader to Isolate Log42j and Slf4j . Console log: Properties contains an invalid element or attr ibute "property" [logging-log4j2]

jhl221123 (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.devel
Message-ID <ghd-D_kwDOAKJSSM4AiiR0-dd807da7-7fca-40fb-9644-2af2778be686__8319.4905355171$1761129307$gmane$org@gitbox.apache.org>
GitHub user jhl221123 added a comment to the discussion: Using Custom ClassLoader to Isolate Log42j and Slf4j. Console log: Properties contains an invalid element or attribute "property"

Hi @zhanjinhao,

I took a look at your `ClassLoader` and it seems that since it doesn't implement `findResource`, resources can only be found in the parent classloader. I believe you can create a much simpler implementation by leveraging `URLClassLoader`.

I've made some changes to demonstrate this, which also include a check for already-loaded classes and support for parallel-capability. You can review the code [here](https://github.com/jhl221123/log-learn/tree/feature/improve-classloader) :) I've confirmed that with this approach, `app_logs` and `agent_logs` are separated correctly.

GitHub link: https://github.com/apache/logging-log4j2/discussions/3960#discussioncomment-14749752

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.