Flogger: A new fluent logging API for Java

Self-documenting log statements may be what first caught our eye, but Flogger, a new fluent logging API for Java, has a lot to offer for developers looking to manage their logging better.

Managing logs isn’t easy. But thanks to a new fluent logging API for Java, Flogger makes it even easier to manage logs and find errors wherever they might be hiding.

Flogger

Flogger joins a crowded field of Java logging APIs: there are lots of specialist debug logging APIs out there for Google’s codebase. So why add to the pile? Well, Flogger is intended to be a generalist logging API, suitable for most Java projects in Google.

Flogger is a somewhat verbose logging API, but don’t let the additional typing scare you. This API makes it even easier to gather more information from event logging than classical logging APIs.

Flogger has a number of other benefits over other APIs. For one, logging at disabled levels is effectively free. Developers can add as many fine-grained log statements to their code as they want, without worry. It also has very high performance for enabled log statements.

Additionally, a fluent API accommodates a variety of present and future features without combinatorial explosion, and without requiring separate logging facades. There’s also less reliance on long parameter lists makes it harder to misuse and yields more self-documenting code.

If you’re interested about learning more, head on over to their website – they have a lot of information available about Flogger, its benefits, best practices, and even the anatomy of a logging API for a deeper dive into the rationale behind this new logger. Head on over to their GitHub page to see more!

One response to “Flogger: A new fluent logging API for Java”

I’m still unclear about what flogger IS. Is this an API that uses an underlying framework to do the actual logging (slf4j) or if it actually performs the logging (logback/log4j2). In EITHER case it’s not documented on how to actually use the library. If the first, how do i bind to a backend? If the latter how do i configure my actual log appenders??