Skip to content

logstash

Matt Hicks edited this page Mar 28, 2019 · 5 revisions

Logstash Logging

If you add the scribe-logstash dependency to your project you can configure Scribe to log to Logstash (https://www.elastic.co/products/logstash).

This will only work on the JVM variant.

libraryDependencies += "com.outr" %% "scribe-logstash" % "2.7.3"

Using Logstash is as simple as instantiating a LogstashWriter and adding a handler for it:

val writer = LogstashWriter(URL("https://your.server.com/logstash"), "service name", asynchronous = true)
Logger.root.withHandler(writer = writer).replace()

That's it! Now all logging that reaches the root logger will be sent to logstash.