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]

Reply via email to