Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use slf4j and log4j properly #27

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,6 @@
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
Expand All @@ -186,12 +181,6 @@
<artifactId>avro</artifactId>
<version>${avro.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.avro/avro-tools -->
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro-tools</artifactId>
<version>${avro.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/skodjob/datagenerator/DataGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
import io.skodjob.datagenerator.handlers.PayrollHandler;
import io.skodjob.datagenerator.handlers.StarGateHandler;
import io.skodjob.datagenerator.handlers.StarWarsHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Objects;

/**
* This class is responsible for generating data based on specified templates.
*/
public class DataGenerator {
private static final Logger LOGGER = LogManager.getLogger(DataGenerator.class);
private static final Logger LOGGER = LoggerFactory.getLogger(DataGenerator.class);

private final ETemplateType templateType;

Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = TFConfig
name = DataGeneratorConfig

appender.console.type = Console
appender.console.name = STDOUT
Expand All @@ -7,8 +7,8 @@ appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss}{GMT} [%thread] %highli

appender.rolling.type = RollingFile
appender.rolling.name = RollingFile
appender.rolling.fileName = ${env:TEST_LOG_DIR:-target/logs}/load-generator-debug-${env:BUILD_ID:-0}.log
appender.rolling.filePattern = ${env:TEST_LOG_DIR:-target/logs}/load-generator-debug-%d{yyyy-MM-dd-HH-mm-ss}-%i.log.gz
appender.rolling.fileName = ${env:TEST_LOG_DIR:-target/logs}/data-generator-debug-${env:BUILD_ID:-0}.log
appender.rolling.filePattern = ${env:TEST_LOG_DIR:-target/logs}/data-generator-debug-%d{yyyy-MM-dd-HH-mm-ss}-%i.log.gz
appender.rolling.policies.type = Policies
appender.rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.rolling.policies.size.size=100MB
Expand All @@ -17,9 +17,9 @@ appender.rolling.strategy.max = 5
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern=%d{yyyy-MM-dd HH:mm:ss}{GMT} %-5p [%c{1}:%L] %m%n

rootLogger.level = ${env:TEST_ROOT_LOG_LEVEL:-DEBUG}
rootLogger.level = ${env:LOG_LEVEL:-DEBUG}
rootLogger.appenderRef.console.ref = STDOUT
rootLogger.appenderRef.console.level = ${env:TEST_LOG_LEVEL:-INFO}
rootLogger.appenderRef.console.level = ${env:LOG_LEVEL:-INFO}
rootLogger.appenderRef.rolling.ref = RollingFile
rootLogger.appenderRef.rolling.level = DEBUG
rootLogger.additivity = false
Expand Down