Skip to content

Commit

Permalink
[#noissue] Remove deprecated PLogger API
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Nov 15, 2024
1 parent c350c48 commit 2850116
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 44 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ private void addTraceExecutor(final String className) {
}

public static class ExecutorExecuteTransformCallback implements TransformCallback {
// private final PLogger logger = PLoggerFactory.getLogger(getClass());

@Override
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader classLoader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


public class CommandInterceptor extends AsyncContextSpanEventSimpleAroundInterceptor {
// private final PLogger logger = PLoggerFactory.getLogger(this.getClass());

public CommandInterceptor(TraceContext traceContext, MethodDescriptor methodDescriptor) {
super(traceContext, methodDescriptor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.navercorp.pinpoint.profiler.logging;

import com.navercorp.pinpoint.bootstrap.logging.PLogger;
import com.navercorp.pinpoint.bootstrap.logging.PluginLogger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker;

Expand All @@ -25,8 +25,7 @@
/**
* @author emeroad
*/
@SuppressWarnings("deprecation")
public class Log4J2PluginLoggerAdapter extends AbstractLoggerAdapter implements PLogger {
public class Log4J2PluginLoggerAdapter extends AbstractLoggerAdapter implements PluginLogger {

private final Logger logger;
private final boolean isDebug;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void start() {
logger.info("LoggerContextFactory:{} LoggerContext:{}", LogManager.getFactory().getClass().getName(), loggerContext.getClass().getName());

this.binder = new Log4j2Binder(loggerContext);
bindPLoggerFactory(this.binder);
bindPluginLogFactory(this.binder);

this.setupGrpcLogger(loggerContext);
}
Expand Down Expand Up @@ -84,8 +84,7 @@ private void setupGrpcLogger(LoggerContext loggerContext) {


private Logger getLoggerContextLogger() {
Logger logger = loggerContext.getLogger(getClass().getName());
return logger;
return loggerContext.getLogger(getClass().getName());
}


Expand Down Expand Up @@ -155,11 +154,11 @@ private void rollback(String key, String backup) {
}


private void bindPLoggerFactory(PluginLoggerBinder binder) {
private void bindPluginLogFactory(PluginLoggerBinder binder) {
final String binderClassName = binder.getClass().getName();
PluginLogger pluginLogger = binder.getLogger(binder.getClass().getName());
pluginLogger.info("PLoggerFactory.initialize() bind:{} cl:{}", binderClassName, binder.getClass().getClassLoader());
// Set binder to static LoggerFactory
pluginLogger.info("PluginLogManager.initialize() bind:{} cl:{}", binderClassName, binder.getClass().getClassLoader());
// Set binder to static PluginLogManager
// Should we unset binder at shutdown hook or stop()?
PluginLogManager.initialize(binder);
}
Expand Down

0 comments on commit 2850116

Please sign in to comment.