candyleer opened a new issue #1055: log toolkit may do not take effect in some
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [x] Bug
- [ ] Requirement
- [ ] Feature or performance improvement
- What do you want to know?
- Which version of SkyWalking, OS and JRE?
- Which company or project?
- What happen?
when i start an app (called `test_app`) in IDE,i configure the logback file
by following this
i found it didn't take effect.
i debug this question step by step in `agent` jar. i found the class
didn't been transformed.this seems to be strange.what is it happened?
then i put an `break point` in this place,
and see the `debug` stack trace in ide ,Suddenly I understand.
from this picture, we can see that the `TraceIdPatternLogbackLayout` class
was loaded in `premain` method,and invoke by `boot` method.but at that time,the
`byte buddy instrument` didn't work.because the code is
that is the class `TraceIdPatternLogbackLayout` loaded is before
**this only happens when application code is loaded by
`AppClassLoader`,because the `logback.xml` in this classpath.**
in other cases,this code work fine cause their classloader is redefined like
`spring boot` or `tomcat` etc. in this cases,the class
`TraceIdPatternLogbackLayout` will be loaded only by app code invoke `logger`
,when `agent` started by `AppClassLoader`,it can not see the `logback.xml`
config file thus he dont know the class `TraceIdPatternLogbackLayout`,
To resolve this problem ,the simplest way is to change the order of
that is first invoke `instrumentation` then boot all service in case of the
boot service contains some method need to be enhanced.
but i dont know if there has some other problem will be caused?
so please check
### Requirement or improvement
- Please describe about your requirements or improvement suggestions.
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
Apache Git Services