Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

one bug or misunderstand about enabled the profiler.logback.logging.transactioninfo=true #1413

Closed
aximo opened this issue Jan 7, 2016 · 2 comments
Assignees
Milestone

Comments

@aximo
Copy link

aximo commented Jan 7, 2016

When i enable profiler.logback.logging.transactioninfo=true, following the document https://github.com/naver/pinpoint/blob/master/doc/per-request_feature_guide.md, however, the MDC is not added to logger message.

I check the code of com.navercorp.pinpoint.profiler.DefaultAgent, I found it using

private final Logger logger = LoggerFactory.getLogger(this.getClass());

in my option, above code will load the ch.qos.logback.classic.spi.LoggingEvent before the plugins loaded, so the transform method will never be invoked in com.navercorp.pinpoint.profiler.plugin.MatchableClassFileTransformerGuardDelegate via jvm, as jvm think it is already loaded

i also debug the agent, i found the breakpoint in the doInTransform in LogbackPlugin never be catched.

it is a bug? or i have a misunderstand about it?

I use:
spring boot 1.2.6-release
logback 1.1.3
slf4j 1.7.12

@minwoo-jung minwoo-jung self-assigned this Jan 12, 2016
@minwoo-jung
Copy link
Member

We also found problems when use spring boot with pinpoint agent.
We will analyze this problem.

@minwoo-jung
Copy link
Member

I pushed patch code to master branch #1478.

for reference,
Pinpoint core logic uses java logger.

Spring-boot has jul-to-slf4j library as one of its dependencies, and it uses this library to change the java logger handler to logback handler at initialization time.
If the java logger handler is changed like this, all the related logback classes are loaded earlier than expected and the transformation callback is not executed.

@minwoo-jung minwoo-jung added this to the 1.5.2 milestone Feb 1, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants