Git Product home page Git Product logo

influxdb-log4j2's Introduction

influxdb-log4j2

An InfluxDB Log4j 2 appender.

This implementation intends to add influxdb support to the Log4j 2 NoSQL appenders list.

Usage

Follows a few sample configurations for the InfluxDb appender:

TCP mode:

    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration status="error">
      <Appenders>
        <NoSql name="databaseAppender">
			<InfluxDb databaseName="applicationDb" seriesName="applicationLog"
				url="http://sandbox.influxdb.com:8086/" username="loggingUser"
				password="abc123" />
        </NoSql>
      </Appenders>
      <Loggers>
        <Root level="warn">
          <AppenderRef ref="databaseAppender"/>
        </Root>
      </Loggers>
    </Configuration>

UDP mode

    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration status="error">
      <Appenders>
        <NoSql name="databaseAppender">
			<InfluxDb seriesName="applicationLog" url="http://sandbox.influxdb.com:8086/"
			username="loggingUser" password="abc123" transport="UDP" udpPort="4444" />
        </NoSql>
      </Appenders>
      <Loggers>
        <Root level="warn">
          <AppenderRef ref="databaseAppender"/>
        </Root>
      </Loggers>
    </Configuration>

Maven

      <dependency>
        <groupId>com.cbnt</groupId>
        <artifactId>influxdb-log4j2</artifactId>
        <version>0.1-SNAPSHOT</version>
      </dependency>

Sample Data

An example of an exception logged with influxdb-log4j2:

time sequence_number thrown.type threadName source.className source.lineNumber thrown.message source.fileName contextStack thrown.stackTrace marker date level thrown.cause.message source.methodName message thrown.cause.type millis thrown.cause.stackTrace loggerName
1433015646874 200001 java.lang.RuntimeException main com.cbnt.HelloWorld 13 A Random exception HelloWorld.java [] [{fileName=HelloWorld.java, methodName=testC, className=com.cbnt.HelloWorld, lineNumber=28}, {fileName=HelloWorld.java, methodName=testB, className=com.cbnt.HelloWorld, lineNumber=23}, {fileName=HelloWorld.java, methodName=testA, className=com.cbnt.HelloWorld, lineNumber=19}, {fileName=HelloWorld.java, methodName=main, className=com.cbnt.HelloWorld, lineNumber=11}] May 30, 2015 4:54:06 PM ERROR A Random inner exception main Ohhh no, a fucking exception java.lang.Exception 1433015646746 [{fileName=HelloWorld.java, methodName=testC, className=com.cbnt.HelloWorld, lineNumber=28}, {fileName=HelloWorld.java, methodName=testB, className=com.cbnt.HelloWorld, lineNumber=23}, {fileName=HelloWorld.java, methodName=testA, className=com.cbnt.HelloWorld, lineNumber=19}, {fileName=HelloWorld.java, methodName=main, className=com.cbnt.HelloWorld, lineNumber=11}] com.cbnt.HelloWorld

Build Requirements

  • Java 1.6+
  • Maven 3.0+

This implementation is still on early development days and hasn't been published yet to any public maven repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.