Skip to content

Commit

Permalink
Merge pull request #1 from gorillalabs/v0.3.0
Browse files Browse the repository at this point in the history
V0.3.0
  • Loading branch information
jenslehnhoff authored Jul 27, 2016
2 parents 4a92c8b + fffa74b commit 0ea3177
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,19 @@
# logback-riemann-appender [![Build Status](https://travis-ci.org/walmartlabs/logback-riemann-appender.svg?branch=master)](https://travis-ci.org/walmartlabs/logback-riemann-appender)
# logback-riemann-appender [![Build Status](https://travis-ci.org/gorillalabs/logback-riemann-appender.svg?branch=master)](https://travis-ci.org/gorillalabs/logback-riemann-appender)

Forked from: https://github.com/kyleburton/logback-riemann-appender
Forked from: https://github.com/walmartlabs/logback-riemann-appender

## Logback appender for [Riemann](http://riemann.io/)

- Sends logging events to Riemann via UDP
- Supports configurable level-based filtering of log events via the
`riemannLogLevel` config property
- Maps attributes of the log event to a Riemann event as follows:

Log Event | Riemann Event
------------------------------- | -------------
rendered message | `:log/message`
`level` | added as a custom attribute: `:log/level`
Marker name | prefixed with `log/` and added to `:tags`
each key-value pair in the MDC | added as a custom attribute with key in the `:log` ns
throwableProxy, if it exists | custom attribute: `:log/stacktrace`
name of the logger | custom attribute: `:log/logger`

:host and :service are set via configuring `logback.xml` as below. You
can also configure `customAttributes` for the logger -- these will be
added to the Riemann event as custom attributes. Each of the keys of
the custom attributes will be in the `log` namespace.
- extended by service name (read from logback.xml), state (adapt event log level) and tags (can be add via list in log message)
- for more basic information read in forked projekcts
https://github.com/walmartlabs/logback-riemann-appender/blob/master/README.md
https://github.com/kyleburton/logback-riemann-appender


## Usage

Artifacts are available through
[clojars](https://clojars.org/com.walmartlabs/logback-riemann-appender) which you can add
[clojars](https://clojars.org/gorillalabs/logback-riemann-appender) which you can add
to your maven repository like so:

```xml
Expand Down
12 changes: 12 additions & 0 deletions java/com/walmartlabs/logback/RiemannAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ private String asString(ILoggingEvent logEvent) {
private EventDSL createRiemannEvent(ILoggingEvent logEvent) {
EventDSL event = riemannClient.event()
.host(hostname)
.service(serviceName)
.state(resolveState(logEvent))
// timestamp is expressed in millis,
// `time` is expressed in seconds
.time(logEvent.getTimeStamp() / 1000)
Expand Down Expand Up @@ -276,4 +278,14 @@ public void setTcp(boolean b) {
public void setDebug(boolean b) {
debug = b;
}

/**
* Use Logging Event-Level as state value.
*
* @param logEvent
* @return
*/
public String resolveState(ILoggingEvent logEvent){
return logEvent.getLevel().toString().toLowerCase();
}
}
8 changes: 4 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defproject com.walmartlabs/logback-riemann-appender "0.2.0"
(defproject com.walmartlabs/logback-riemann-appender "0.3.0"
:description "Logback Appender that sends events to Riemann"
:url "https://github.com/walmartlabs/logback-riemann-appender"
:url "https://github.com/gorillalabs/logback-riemann-appender"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:java-source-paths ["java"]
Expand All @@ -13,11 +13,11 @@
:source-paths ["test/clojure"]
:java-source-paths ["test/java"]}
:repl {:source-paths ["dev"]}}
:dependencies [[org.clojure/clojure "1.7.0"]
:dependencies [[org.clojure/clojure "1.8.0"]
[com.aphyr/riemann-java-client "0.2.8"]
[ch.qos.logback/logback-classic "1.1.3"]
[org.clojure/tools.logging "0.3.1"]]
:signing {:gpg-key "[email protected]"}
:signing {:gpg-key "[email protected]"}
:aliases {"test" ["do", "jar," "test"]}
:release-tasks [["vcs" "assert-committed"]
["change" "version" "leiningen.release/bump-version" "release"]
Expand Down
8 changes: 8 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Release Notes

## v0.3.0 - July 27st, 2016

....



# Release Notes

## v0.2.0 - July 21st, 2016
Expand Down
File renamed without changes.

0 comments on commit 0ea3177

Please sign in to comment.