logback-plotmachine is a logback appender for PlotMachine.
The appender sends asynchronous non blocking HTTP calls to a PlotMachine server for every log Event.
It uses the Logger name as the name and the message as the value.
public class MyClass {
Logger logger = LoggerFactory.getLogger("UpdateTime");
public void myMethod() {
// long time = ... get the time
long time = 10;
logger.info(time);
}
}
<configuration scan="false" debug="false">
<appender name="plotmachine" class="me.shimi.logback.PlotMachineAppender">
<ApiUrl>http://mydomain/PlotMachine/api/monitor/data/add?</ApiUrl>
</appender>
<root level="INFO">
<appender-ref ref="plotmachine" />
</root>
</configuration>
The appender will make HTTP call to
http://mydomain/PlotMachine/api/monitor/data/add?name=UpdateTime&value=10
You can download the jar from the Downloads section or setup your maven configuration with the following settings:
<repositories> <repository> <id>Shimi</id> <name>Shimi Snapshot Repo</name> <url>https://github.com/Shimi/shimi-mvn-repo/tree/master/snapshots</url> </repository> </repositories> <dependencies> <dependency> <groupId>me.shimi.logback</groupId> <artifactId>logback-plotmachine</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies>