diff --git a/pom.xml b/pom.xml index 0855ce4..c9d64ac 100644 --- a/pom.xml +++ b/pom.xml @@ -1,229 +1,223 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <packaging>jar</packaging> - <modelVersion>4.0.0</modelVersion> - <groupId>com.teragrep</groupId> - <artifactId>jla_01</artifactId> - <version>${revision}${sha1}${changelist}</version> - <name>jla_01</name> - <description>Reliable Event Logging Protocol (RELP) Logback plugin</description> - <url>https://teragrep.com</url> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <java.version>1.8</java.version> - <revision>0.0.1</revision> - <changelist>-SNAPSHOT</changelist> - <sha1/> - </properties> - - <licenses> - <license> - <name>Apache License 2.0</name> - <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> - </license> - </licenses> - - <developers> - <developer> - <name>Mikko Kortelainen</name> - <email>1@teragrep.com</email> - <organization>Teragrep</organization> - <organizationUrl>https://teragrep.com</organizationUrl> - </developer> - </developers> - - <scm> - <connection>scm:git:https://github.com/teragrep/jla_01.git</connection> - <developerConnection>scm:git:git@github.com:teragrep/jla_01.git</developerConnection> - <url>https://github.com/teragrep/jla_01/tree/master</url> - </scm> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <packaging>jar</packaging> + <modelVersion>4.0.0</modelVersion> + <groupId>com.teragrep</groupId> + <artifactId>jla_01</artifactId> + <version>${revision}${sha1}${changelist}</version> + <name>jla_01</name> + <description>Reliable Event Logging Protocol (RELP) Logback plugin</description> + <url>https://teragrep.com</url> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <java.version>1.8</java.version> + <revision>0.0.1</revision> + <changelist>-SNAPSHOT</changelist> + <sha1/> + </properties> - <dependencies> - <dependency> - <groupId>com.teragrep</groupId> - <artifactId>rlp_01</artifactId> - <version>3.3.1</version> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <version>1.2.9</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-core</artifactId> - <version>1.2.9</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.11</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.cloudbees</groupId> - <artifactId>syslog-java-client</artifactId> - <version>1.1.7</version> - </dependency> + <licenses> + <license> + <name>Apache License 2.0</name> + <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>3.6.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-inline</artifactId> - <version>3.6.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <version>5.4.0-RC1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.platform</groupId> - <artifactId>junit-platform-launcher</artifactId> - <version>1.4.0-RC1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.13.1</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <version>5.4.0-RC1</version> - <scope>test</scope> - </dependency> + <developers> + <developer> + <name>Mikko Kortelainen</name> + <email>1@teragrep.com</email> + <organization>Teragrep</organization> + <organizationUrl>https://teragrep.com</organizationUrl> + </developer> + </developers> - - </dependencies> - - <build> - <directory>${project.basedir}/target</directory> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <version>2.2.1</version> - <executions> - <execution> - <id>attach-sources</id> - <goals> - <goal>jar-no-fork</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.9.1</version> - <executions> - <execution> - <id>attach-javadocs</id> - <goals> - <goal>jar</goal> - </goals> - <configuration> - <source>8</source> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.1</version> - <configuration> - <source>8</source> - <target>8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.22.2</version> - <configuration> - <parallel>all</parallel> - <useUnlimitedThreads>true</useUnlimitedThreads> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <version>2.8.2</version> - <configuration> - <skip>false</skip> - </configuration> - </plugin> - <plugin> - <groupId>de.smartics.maven.plugin</groupId> - <artifactId>smartics-jboss-modules-maven-plugin</artifactId> - <version>2.1.5</version> - <executions> - <execution> - <id>create-modules-archive</id> - <goals> - <goal>create-modules-archive</goal> - </goals> - <phase>package</phase> - </execution> - </executions> - <configuration> - <slotStrategy>main</slotStrategy> - <defaultSlot>main</defaultSlot> - <attach>true</attach> - <dependencyExcludes> - <exclude> - <groupId>ch.qos.logback</groupId> - </exclude> - <exclude> - <groupId>com.github.spotbugs</groupId> - </exclude> - </dependencyExcludes> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>flatten-maven-plugin</artifactId> - <version>1.1.0</version> - <configuration> - <updatePomFile>true</updatePomFile> - <flattenMode>resolveCiFriendliesOnly</flattenMode> - </configuration> - <executions> - <execution> - <id>flatten</id> - <phase>process-resources</phase> - <goals> - <goal>flatten</goal> - </goals> - </execution> - <execution> - <id>flatten.clean</id> - <phase>clean</phase> - <goals> - <goal>clean</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> + <scm> + <connection>scm:git:https://github.com/teragrep/jla_01.git</connection> + <developerConnection>scm:git:git@github.com:teragrep/jla_01.git</developerConnection> + <url>https://github.com/teragrep/jla_01/tree/master</url> + </scm> + <dependencies> + <dependency> + <groupId>com.teragrep</groupId> + <artifactId>rlp_01</artifactId> + <version>4.0.1</version> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>1.2.9</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>1.2.9</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.11</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.teragrep</groupId> + <artifactId>rlo_14</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>3.6.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-inline</artifactId> + <version>3.6.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>5.4.0-RC1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.junit.platform</groupId> + <artifactId>junit-platform-launcher</artifactId> + <version>1.4.0-RC1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.13.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <version>5.4.0-RC1</version> + <scope>test</scope> + </dependency> + </dependencies> + <build> + <directory>${project.basedir}/target</directory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>2.2.1</version> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar-no-fork</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.9.1</version> + <executions> + <execution> + <id>attach-javadocs</id> + <goals> + <goal>jar</goal> + </goals> + <configuration> + <source>8</source> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <source>8</source> + <target>8</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.22.2</version> + <configuration> + <parallel>all</parallel> + <useUnlimitedThreads>true</useUnlimitedThreads> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8.2</version> + <configuration> + <skip>false</skip> + </configuration> + </plugin> + <plugin> + <groupId>de.smartics.maven.plugin</groupId> + <artifactId>smartics-jboss-modules-maven-plugin</artifactId> + <version>2.1.5</version> + <executions> + <execution> + <id>create-modules-archive</id> + <goals> + <goal>create-modules-archive</goal> + </goals> + <phase>package</phase> + </execution> + </executions> + <configuration> + <slotStrategy>main</slotStrategy> + <defaultSlot>main</defaultSlot> + <attach>true</attach> + <dependencyExcludes> + <exclude> + <groupId>ch.qos.logback</groupId> + </exclude> + <exclude> + <groupId>com.github.spotbugs</groupId> + </exclude> + </dependencyExcludes> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>flatten-maven-plugin</artifactId> + <version>1.1.0</version> + <configuration> + <updatePomFile>true</updatePomFile> + <flattenMode>resolveCiFriendliesOnly</flattenMode> + </configuration> + <executions> + <execution> + <id>flatten</id> + <phase>process-resources</phase> + <goals> + <goal>flatten</goal> + </goals> + </execution> + <execution> + <id>flatten.clean</id> + <phase>clean</phase> + <goals> + <goal>clean</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> <profiles> <profile> <id>publish-maven-central</id> @@ -257,9 +251,9 @@ <url>https://oss.sonatype.org/content/repositories/snapshots</url> </snapshotRepository> <repository> - <id>ossrh</id> - <name>Central Repository OSSRH</name> - <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> + <id>ossrh</id> + <name>Central Repository OSSRH</name> + <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> </repository> </distributionManagement> </profile> @@ -291,9 +285,9 @@ </build> <distributionManagement> <repository> - <id>github</id> - <name>GitHub Packages</name> - <url>https://maven.pkg.github.com/teragrep/jla_01</url> + <id>github</id> + <name>GitHub Packages</name> + <url>https://maven.pkg.github.com/teragrep/jla_01</url> </repository> </distributionManagement> </profile> diff --git a/src/main/java/com/teragrep/jla_01/LoggingEventConverter.java b/src/main/java/com/teragrep/jla_01/LoggingEventConverter.java index 22e82f6..aae0aa0 100644 --- a/src/main/java/com/teragrep/jla_01/LoggingEventConverter.java +++ b/src/main/java/com/teragrep/jla_01/LoggingEventConverter.java @@ -20,10 +20,10 @@ Reliable Event Logging Protocol (RELP) Logback plugin import java.util.Date; import java.util.Map; -import com.cloudbees.syslog.Facility; -import com.cloudbees.syslog.SDElement; -import com.cloudbees.syslog.Severity; -import com.cloudbees.syslog.SyslogMessage; +import com.teragrep.rlo_14.Facility; +import com.teragrep.rlo_14.SyslogMessage; +import com.teragrep.rlo_14.SDElement; +import com.teragrep.rlo_14.Severity; public class LoggingEventConverter { diff --git a/src/main/java/com/teragrep/jla_01/RlpLogbackAppender.java b/src/main/java/com/teragrep/jla_01/RlpLogbackAppender.java index e542991..1e1aed5 100644 --- a/src/main/java/com/teragrep/jla_01/RlpLogbackAppender.java +++ b/src/main/java/com/teragrep/jla_01/RlpLogbackAppender.java @@ -24,10 +24,9 @@ Reliable Event Logging Protocol (RELP) Logback plugin import java.util.concurrent.TimeoutException; import java.util.function.Supplier; -import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.encoder.LayoutWrappingEncoder; -import com.cloudbees.syslog.SDElement; -import com.cloudbees.syslog.SyslogMessage; +import com.teragrep.rlo_14.SDElement; +import com.teragrep.rlo_14.SyslogMessage; import com.teragrep.rlp_01.RelpBatch; import ch.qos.logback.core.AppenderBase; diff --git a/src/test/java/com/teragrep/jla_01/LoggingEventConverterTest.java b/src/test/java/com/teragrep/jla_01/LoggingEventConverterTest.java index e33b9ff..9bcdc5f 100644 --- a/src/test/java/com/teragrep/jla_01/LoggingEventConverterTest.java +++ b/src/test/java/com/teragrep/jla_01/LoggingEventConverterTest.java @@ -20,25 +20,15 @@ Reliable Event Logging Protocol (RELP) Logback plugin import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; -import java.time.Instant; import java.time.LocalDate; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; - -import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; -import org.slf4j.Marker; - -import com.cloudbees.syslog.SyslogMessage; -import com.teragrep.jla_01.LoggingEventConverter; - -import ch.qos.logback.classic.Level; +import com.teragrep.rlo_14.SyslogMessage; import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.classic.spi.IThrowableProxy; -import ch.qos.logback.classic.spi.LoggerContextVO; public class LoggingEventConverterTest {