Skip to content

Commit

Permalink
[#8463] Replace slf4j with log4j2
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Dec 8, 2021
1 parent a189f01 commit 6cf56a7
Show file tree
Hide file tree
Showing 823 changed files with 2,511 additions and 3,192 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import com.navercorp.pinpoint.sdk.v1.concurrent.TraceCallable;
import com.navercorp.pinpoint.sdk.v1.concurrent.TraceExecutors;
import com.navercorp.pinpoint.sdk.v1.concurrent.TraceRunnable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -20,7 +20,7 @@

@RestController
public class ThreadContextPropagationController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());

private final ExecutorService traceExecutor = TraceExecutors.wrapExecutorService(Executors.newSingleThreadExecutor());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.pinpointest.plugin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.Resource;
Expand All @@ -27,7 +27,7 @@
@Component
public class CertService {

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

private final Resource keyStorePath;
private final String password;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.pinpointest.plugin.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -33,7 +33,7 @@
@RestController
public class HttpHeaderController {

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

@GetMapping(value = "/reqHeader")
public String reqHeader(HttpServletRequest request) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.pinpointest.plugin.controller;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -20,7 +20,7 @@

@RestController
public class JdkHttpPluginController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());

public static final String HTTP_TARGET = "%s://localhost:%s/helloworld";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.pinpoint.test.plugin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
Expand All @@ -32,7 +32,7 @@
@RestController
public class PahoMqttController {

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

@Value("${mqtt.v3.broker.url}")
private String v3BrokerUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.pinpoint.test.plugin;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand All @@ -30,7 +30,7 @@
@Component
public class Subscriber {

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

private org.eclipse.paho.mqttv5.client.MqttAsyncClient v5Client;
private org.eclipse.paho.client.mqttv3.MqttAsyncClient v3Client;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.pinpointest.plugin.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -17,7 +17,7 @@

@RestController
public class ThreadPluginController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());

private final ExecutorService executorService = Executors.newSingleThreadExecutor();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ErrorCollector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import java.io.IOException;
import java.util.List;
Expand All @@ -32,7 +32,7 @@
* @author HyunGil Jeong
*/
public class TraceMetadataVerificationTest {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());

private final PinpointPluginLoader<TraceMetadataProvider> traceMetadataProviderLoader = new TraceMetadataProviderLoader();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import com.navercorp.pinpoint.batch.common.DefaultDivider;
import com.navercorp.pinpoint.batch.common.Divider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.partition.support.Partitioner;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.beans.factory.annotation.Qualifier;
Expand All @@ -31,7 +31,7 @@
* @author minwoo.jung
*/
public class AlarmPartitioner implements Partitioner {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());

private static final String PARTITION_NAME_PREFIX = "alarm_partition_number_";
private static final String BATCH_NAME = "alarm_batch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
package com.navercorp.pinpoint.batch.alarm;

import com.navercorp.pinpoint.batch.alarm.checker.AlarmChecker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.StepExecution;

/**
* @author minwoo.jung
*/
public class EmptySmsSender implements SmsSender {

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

@Override
public void sendSms(AlarmChecker<?> checker, int sequenceCount, StepExecution stepExecution) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import com.navercorp.pinpoint.batch.alarm.checker.AlarmChecker;
import com.navercorp.pinpoint.batch.common.BatchConfiguration;
import com.navercorp.pinpoint.web.service.UserGroupService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.StepExecution;
import org.springframework.mail.javamail.JavaMailSenderImpl;

Expand All @@ -36,7 +36,7 @@
public class SpringSmtpMailSender implements MailSender {

private static final InternetAddress[] EMPTY_RECEIVERS = new InternetAddress[0];
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());

private final UserGroupService userGroupService;
private final String batchEnv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import com.navercorp.pinpoint.web.service.WebhookService;
import com.navercorp.pinpoint.web.vo.User;
import com.navercorp.pinpoint.web.vo.Webhook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.StepExecution;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
Expand All @@ -43,7 +43,7 @@
*/
public class WebhookSenderImpl implements WebhookSender {

private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());
private final UserService userService;
private final RestTemplate restTemplate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.navercorp.pinpoint.batch.alarm.vo.sender.payload.AlarmCheckerDetectedValue;
import com.navercorp.pinpoint.batch.alarm.vo.sender.payload.CheckerDetectedValue;
import com.navercorp.pinpoint.web.alarm.vo.Rule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import java.util.LinkedList;
import java.util.List;
Expand All @@ -34,7 +34,7 @@
*/
public abstract class AlarmChecker<T> {

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

protected final Rule rule;
protected final String unit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import com.navercorp.pinpoint.common.server.config.AnnotationVisitor;
import com.navercorp.pinpoint.common.server.config.LoggingEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand All @@ -32,7 +32,7 @@
@Component
public class BatchConfiguration {

private final Logger logger = LoggerFactory.getLogger(BatchConfiguration.class);
private final Logger logger = LogManager.getLogger(BatchConfiguration.class);

@Value("${alarm.mail.server.url}")
private String emailServerUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.navercorp.pinpoint.batch.common;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.configuration.JobLocator;
Expand All @@ -30,7 +30,7 @@
*/
public class BatchJobLauncher extends JobLaunchSupport {

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

public static final String CLEANUP_INACTIVE_AGENTS_JOB_NAME = "cleanupInactiveAgentsJob";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.navercorp.pinpoint.batch.flink;

import com.navercorp.pinpoint.batch.common.BatchConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
Expand All @@ -39,7 +39,7 @@
@Deprecated
public class HealthCheckTasklet implements Tasklet {

private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());
private final static String URL_FORMAT = "http://%s:8081/joboverview";
private final List<String> jobNameList;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.navercorp.pinpoint.batch.flink;

import com.navercorp.pinpoint.batch.common.BatchConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
Expand All @@ -38,7 +38,7 @@
*/
public class HealthCheckTaskletV2 implements Tasklet {

private final Logger logger = LoggerFactory.getLogger(this.getClass());
private final Logger logger = LogManager.getLogger(this.getClass());
private final static String URL_FORMAT = "http://%s:8081/jobs/overview";
private final static String NAME = "name";
private final static String STATE = "state";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import com.navercorp.pinpoint.batch.common.BatchConfiguration;
import com.navercorp.pinpoint.web.service.AdminService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
Expand All @@ -32,7 +32,7 @@
*/
public class CleanupInactiveAgentsTasklet implements Tasklet {

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

private final int durationDays;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import com.navercorp.pinpoint.web.vo.Range;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;

import java.util.ArrayList;
import java.util.Collection;
Expand All @@ -41,7 +41,7 @@

public class ErrorCountToCalleCheckerTest {

private static final Logger logger = LoggerFactory.getLogger(ErrorCountToCalleCheckerTest.class);
private static final Logger logger = LogManager.getLogger(ErrorCountToCalleCheckerTest.class);

private static final String FROM_SERVICE_NAME = "from_local_service";
private static final String TO_SERVICE_NAME = "to_local_service";
Expand Down
4 changes: 2 additions & 2 deletions bootstraps/bootstrap-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

<!-- Logging dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 6cf56a7

Please sign in to comment.