# Scribe

**Fast Scala logging, with nothing to configure.** — Open source

[View on GitHub](https://matthicks.com/https://github.com/outr/scribe)

One line to start

libraryDependencies += "com.outr" %% "scribe" % "<version>"

scribe.info("Yes, it's that simple!")

There is no configuration file to write, no logger to create, and nothing to mix into your classes. The class, method, and line number of each message are worked out when your code compiles, so every log line carries them at no cost at runtime. Java loggers have to walk the stack to find the same information, which is why they usually leave it switched off.

Configured in code

Configuration is ordinary Scala, so it can come from any configuration library, or change while a server is running. Turn on debug logging for one package to chase a production problem, then turn it back off, without a restart.

import scribe.Level import scribe.file.*

val logFile = "logs" / ("app-" % year % "-" % month % "-" % day % ".log")

scribe.Logger.root .clearHandlers() .withHandler(minimumLevel = Some(Level.Info)) .withHandler(writer = FileWriter(logFile), minimumLevel = Some(Level.Warn)) .replace()

scribe.Logger("shop.payments").withMinimumLevel(Level.Debug).replace()

Everywhere Scala runs

Scribe runs on the JVM, Scala.js, and Scala Native, and is published for Scala 2.12, 2.13, and 3.

Built for speed

Performance was the point from the start. Positions are resolved at compile time, and asynchronous logging takes the remaining cost off your application's threads entirely. The 2018 benchmarks, written up below, compared it with Log4j 2 and Scala Logging on file logging.

Works with what you already use

SLF4J 1 and 2, Log4j, and Java Platform Logging bridges send the logging from Java libraries through Scribe.

Rolling log files by date or size, with paths built in code.

JSON output with fabric or circe, and Logstash for log pipelines.

Slack notifications for the messages that need a person.

Cats Effect integration.

Scribe has been in development since 2016. It is MIT licensed, and the latest version is listed on GitHub. It is the logger behind LightDB, Sigil, NaboTV, Voidcraft, and the site you are reading.

## Links

- [Documentation](https://matthicks.com/https://github.com/outr/scribe/wiki)

## Writing about Scribe

- [Scribe 2.0: Fastest JVM Logger in the World!](https://matthicks.com/2018/02/06/scribe-2-0-fastest-jvm-logger-in-the-world/) — February 6, 2018. An intentionally provocative heading, but one I stand behind until someone can prove otherwise (and I welcome just that). Scribe 1.x was pretty fast (https://matthicks.com/2017/01/12/logging-performance/), but was not written with performance in mind. When I came back around and realized just how…
- [Logging Performance](https://matthicks.com/2017/01/12/logging-performance/) — January 12, 2017. I've never been a fan of the setup of logging frameworks as far back as when I was a Java developer. The hassle and complexity of configuring and managing the logging framework was always a big hassle and would often create serious problems in the application if not done right. Even today in Scala…
