Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ For questions or support, please use the [GitHub repository Issues](https://gith
- [Kinesis Stream](https://aws.amazon.com/kinesis/data-streams/)
- depends on [kinesis(v2) or aws-java-sdk-kinesis(v1)](http://aws.amazon.com/sdkforjava/).

- [fluentd](http://fluentd.org/)
- [fluentd](http://fluentd.org/) [(DEPRECATED)](https://github.com/fluent/fluent-logger-java/issues/99) use fluency instead
- depends on [fluent-logger for Java](https://github.com/fluent/fluent-logger-java).
- Install fluentd before running logger.
- Install fluentd before running logger.

- [fluency](https://github.com/komamitsu/fluency)
- depends on [fluency](https://github.com/komamitsu/fluency).
Expand Down
68 changes: 50 additions & 18 deletions pom-JAVA9MODULE_SLF4J17.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

<properties>
<fluentd.logger.version>0.3.4</fluentd.logger.version>
<fluency.version>2.5.1</fluency.version>
<logback.version>1.2.3</logback.version>
<slf4j.version>1.7.26</slf4j.version>
<jackson.version>2.12.3</jackson.version>
<aws.version>1.11.1000</aws.version>
<aws-v2.version>2.16.43</aws-v2.version>
<fluency.version>2.6.5</fluency.version>
<logback.version>1.2.13</logback.version>
<slf4j.version>1.7.36</slf4j.version>
<jackson.version>2.10.5</jackson.version>
<aws.version>1.11.1034</aws.version>
<aws-v2.version>2.16.104</aws-v2.version>
<jdk.version>9</jdk.version>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
Expand All @@ -34,7 +34,7 @@
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.0</version>
<version>5.0.0</version>
<configuration>
<aggregate>true</aggregate>
<strictCheck>true</strictCheck>
Expand All @@ -48,15 +48,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>3.4.0</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<version>3.6.1</version>
<executions>
<execution>
<id>add-source</id>
Expand All @@ -75,7 +75,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.14.1</version>
<configuration>
<fork>true</fork>
<release>9</release>
Expand All @@ -87,7 +87,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -100,7 +100,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -110,15 +110,47 @@
</execution>
</executions>
<configuration>
<source>8</source>
<additionalParam>-Xdoclint:none</additionalParam>
<source>${jdk.version}</source>
<doclint>none</doclint>
<additionalOptions>
<additionalOption>--no-module-directories</additionalOption>
</additionalOptions>
<detectJavaApiLink>false</detectJavaApiLink>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>3.9.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${jdk.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -211,7 +243,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -263,7 +295,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -277,7 +309,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
56 changes: 42 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

<properties>
<fluentd.logger.version>0.3.4</fluentd.logger.version>
<fluency.version>2.5.1</fluency.version>
<logback.version>1.2.3</logback.version>
<jackson.version>2.12.3</jackson.version>
<aws.version>1.11.1000</aws.version>
<aws-v2.version>2.16.43</aws-v2.version>
<fluency.version>2.6.5</fluency.version>
<logback.version>1.2.13</logback.version>
<jackson.version>2.10.5</jackson.version>
<aws.version>1.11.1034</aws.version>
<aws-v2.version>2.16.104</aws-v2.version>
<jdk.version>8</jdk.version>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
Expand All @@ -33,7 +33,7 @@
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>4.0</version>
<version>5.0.0</version>
<configuration>
<aggregate>true</aggregate>
<strictCheck>true</strictCheck>
Expand All @@ -47,15 +47,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>3.5.0</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.15.0</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>${jdk.version}</source>
Expand All @@ -65,7 +65,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -78,7 +78,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -89,14 +89,42 @@
</executions>
<configuration>
<source>${jdk.version}</source>
<additionalParam>-Xdoclint:none</additionalParam>
<doclint>none</doclint>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>3.10.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.21.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.3</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${jdk.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -226,7 +254,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -240,7 +268,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
4 changes: 2 additions & 2 deletions src/java9/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open module org.slf4j {
requires transitive slf4j.api;
open module com.sndyuk.logback.more.appenders {
requires org.slf4j;
requires static logback.core;
requires static logback.classic;
requires static logback.access;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@

import org.fluentd.logger.FluentLogger;

/**
* @deprecated Use {@link FluencyLogbackAppender} instead.
* @since 1.8.9
*/
@Deprecated
public class DataFluentAppender<E> extends FluentdAppenderBase<E> {
private FluentLogger fluentLogger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import ch.qos.logback.core.encoder.LayoutWrappingEncoder;
import ch.qos.logback.more.appenders.marker.MapMarker;



public abstract class FluentdAppenderBase<E> extends AppenderBase<E> {
private static final String DATA_MESSAGE = "message";
private static final String DATA_LOGGER = "logger";
Expand Down Expand Up @@ -82,9 +80,7 @@ protected Map<String, Object> createData(E event) {
if (loggingEvent.getThrowableProxy() != null) {
data.put(DATA_THROWABLE, ThrowableProxyUtil.asString(loggingEvent.getThrowableProxy()));
}
for (Map.Entry<String, String> entry : loggingEvent.getMDCPropertyMap().entrySet()) {
data.put(entry.getKey(), entry.getValue());
}
data.putAll(loggingEvent.getMDCPropertyMap());
} else {
data.put(messageFieldKeyName, encoder != null ? encoder.encode(event) : event.toString());
}
Expand Down Expand Up @@ -128,9 +124,6 @@ protected String markerName() {

/**
* Get map marker name if map is provided
*
* @param mapMarker
* @return
*/
protected String mapMarkerName(MapMarker mapMarker) {
if ((mapMarker == null) || (emptyString(mapMarker.getName()))) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package ch.qos.logback.more.appenders.encoder;

import ch.qos.logback.classic.pattern.ThrowableHandlingConverter;
import ch.qos.logback.classic.pattern.ThrowableProxyConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.pattern.Converter;
import ch.qos.logback.core.pattern.DynamicConverter;
import ch.qos.logback.core.pattern.LiteralConverter;

/**
* JSON encoder. It just escape meta characters of JSON not to lose performance. It doesn't handle
* JSON encoder. It just escapes meta characters of JSON not to lose performance. It doesn't handle
* null value.
*
* @author sndyuk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import ch.qos.logback.classic.PatternLayout;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.pattern.Converter;
import ch.qos.logback.core.pattern.FormattingConverter;
import ch.qos.logback.core.pattern.PatternLayoutBase;
import ch.qos.logback.core.pattern.PatternLayoutEncoderBase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class FluentdAppenderBaseTest {
/**
* Creating a test appender to be a test proxy
*/
class TestAppender<E> extends FluentdAppenderBase<E> {
static class TestAppender<E> extends FluentdAppenderBase<E> {
protected List<E> appended = new ArrayList<E>();

@Override
Expand All @@ -48,7 +48,7 @@ protected void append(E event) {

}

class TestEvent implements ILoggingEvent {
static class TestEvent implements ILoggingEvent {

Object[] argumentArray = { "arg1", "arg2" };
StackTraceElement[] callerData;
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/logback-appenders-fluentd.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<included>

<!-- Fluend java -->
<!-- Fluend java (DEPRECATED) use Fluency instead -->

<appender name="FLUENT_SYNC"
class="ch.qos.logback.more.appenders.DataFluentAppender">
Expand Down