A custom logback Appender that writes metrics to a Graphite server using Graphite's "plain text protocol".
To implement, put the jar on your classpath. From the base project directory:
- mvn clean package
- mvn install:install-file -DgroupId=com.jasonnerothin -DartifactId=logback-graphite -Dversion=1.0 -Dpackaging=jar -Dfile=target/logback-graphite-1.0.jar
- Include the dependency in your pom file:
<dependency><groupId>com.jasonnerothin</groupId><artifactId>logback-graphite</artifactId><version>1.0</version></dependency>
To configure:
Configure a logback appender like src/main/resources/logback-test.xml.
To run:
- Provide two Java properties at runtime:
-Dgraphite.host=com.yourhost.name -Dgraphite.port=2003
- Pass the logback configuration on the command line or in your classpath:
-Dlogback.configurationFile=nameofyourfile.xml
Ship.