Skip to content

Commit

Permalink
Prepaartion for maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
asm0dey committed May 3, 2017
1 parent 1560d6f commit 9170679
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 56 deletions.
145 changes: 105 additions & 40 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,55 +1,20 @@
<?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"
<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">
<modelVersion>4.0.0</modelVersion>

<groupId>ru.sberned</groupId>
<artifactId>kafka-logback</artifactId>
<version>1.0.1</version>
<licenses>
<license>
<name>BSD 3-Clause</name>
<url>https://raw.githubusercontent.com/Sberned/kafka-logback/master/LICENSE</url>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/Sberned/kafka-logback.git</connection>
<developerConnection>scm:git:https://github.com/Sberned/kafka-logback.git</developerConnection>
<url>https://github.com/Sberned/kafka-logback</url>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<version>1.0.2</version>
<packaging>jar</packaging>

<name>kafka-logback</name>
<description>Configurable kafka appender for logback</description>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down Expand Up @@ -108,4 +73,104 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.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.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
<url>https://github.com/Sberned/kafka-logback/</url>
<licenses>
<license>
<name>BSD 3-Clause</name>
<url>https://raw.githubusercontent.com/Sberned/kafka-logback/master/LICENSE</url>
</license>
</licenses>
<developers>
<developer>
<name>Eugenia Patuk</name>
<email>[email protected]</email>
<organization>Sberned</organization>
<organizationUrl>http://sberned.ru</organizationUrl>
</developer>
<developer>
<name>Paul Finkelshtein</name>
<email>[email protected]</email>
<organization>Sberned</organization>
<organizationUrl>http://sberned.ru</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/Sberned/kafka-logback.git</connection>
<developerConnection>scm:git:https://github.com/Sberned/kafka-logback.git</developerConnection>
<url>https://github.com/Sberned/kafka-logback</url>
</scm>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<goals>
<goal>sign</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
32 changes: 16 additions & 16 deletions src/main/java/ru/sberned/kafkalogback/KafkaAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@

/**
* This appender expects topic, bootstrapServers, valueSerializer and layout as mandatory.
* You could also supply additional kafka customProps in <customProps> tag in the following manner
* <customProps>key1=value1,key2=value2</customProps>
* <p>
* You could also supply additional kafka customProps in &lt;customProps&gt; tag in the following manner
* &lt;customProps&gt;key1=value1,key2=value2&lt;/customProps&gt;
* &lt;p&gt;
* Sample configuration
* <?xml version="1.0" encoding="UTF-8" ?>
* <configuration>
* <appender name="KAFKA" class="ru.sberned.kafkalogback.KafkaAppender">
* <topic>test-topic</topic>
* <bootstrapServers>localhost:2181</bootstrapServers>
* <layout class="ru.sberned.kafkalogback.CustomJsonLayout">
* <jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter"/>
* </layout>
* </appender>
* <root level="trace">
* <appender-ref ref="KAFKA" />
* </root>
* </configuration>
* &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
* &lt;configuration&gt;
* &lt;appender name=&quot;KAFKA&quot; class=&quot;ru.sberned.kafkalogback.KafkaAppender&quot;&gt;
* &lt;topic&gt;test-topic&lt;/topic&gt;
* &lt;bootstrapServers&gt;localhost:2181&lt;/bootstrapServers&gt;
* &lt;layout class=&quot;ru.sberned.kafkalogback.CustomJsonLayout&quot;&gt;
* &lt;jsonFormatter class=&quot;ch.qos.logback.contrib.jackson.JacksonJsonFormatter&quot;/&gt;
* &lt;/layout&gt;
* &lt;/appender&gt;
* &lt;root level=&quot;trace&quot;&gt;
* &lt;appender-ref ref=&quot;KAFKA&quot; /&gt;
* &lt;/root&gt;
* &lt;/configuration&gt;
*/
@Setter
public class KafkaAppender extends AppenderBase<ILoggingEvent> {
Expand Down

0 comments on commit 9170679

Please sign in to comment.