flogger is a free, open source monitoring & observability project written in Java and released under Apache-2.0. It has 1,481 GitHub stars, 133 forks and 53 open issues, and was last pushed 6 days ago. On this registry it ranks #198 of 271 tracked projects in Monitoring & Observability, with 5 head-to-head comparisons available.

What is flogger?

Flogger is a fluent logging API for Java, published under the Apache-2.0 licence by Google, that replaces a wide field of competing Java logging APIs with one unified, self-documenting interface.

What it is

Flogger is a Java logging library built around a fluent interface, in which a logging statement is composed as a chain of method calls rather than as a single call with a long parameter list. A typical statement reads logger.atInfo().withCause(exception).log("Log message with: %s", argument);, and it lives in the Java ecosystem as a Maven artifact published to Maven Central. It is not a log output backend; it is the API that application code calls, with a separate system backend supplying the actual log transport at runtime.

The concrete problem it solves is API fragmentation. Google's codebase grew to contain many different debug logging APIs, each with its own benefits and issues, so developers had to switch between APIs as they moved between projects, and differences between those APIs caused confusion and bugs. Flogger is the result of an attempt to create a unified logging API suitable for the vast majority of Java projects inside Google. After most Google Java code was switched to Flogger, thousands of bugs were fixed and the cost of learning a new logging API per project was eliminated. Flogger is now the sole recommended Java logging API within Google.

Key capabilities

  • Logging at disabled levels is effectively free, so fine-grained log statements can be added without performance worry.
  • High performance for enabled log statements, per the README's stated benefits.
  • Fluent chaining that accommodates present and future features without combinatorial explosion and without requiring separate logging façades.
  • Rate limiting through atMostEvery(30, SECONDS), which suppresses repeated messages within a time window.
  • Deferred argument evaluation via lazy(() -> doExpensiveCalculation()), so expensive work runs only if the message is actually emitted.
  • Cause attachment through withCause(exception), and level entry points such as atInfo() and atSevere().
  • Message formatting with Java's printf format specifiers, including %s, %d and %016x.

Who uses it and how

  • Large Java monorepos where many teams share one logging interface and developers move between projects, avoiding per-project API relearning.
  • Applications that need many fine-grained log statements active in source but effectively free when their level is disabled.
  • Services that need to throttle noisy messages, using atMostEvery around high-frequency code paths.
  • Codebases that want expensive log arguments computed only on demand, using lazy(...) rather than pre-built strings.
  • Teams already inside the Google Java ecosystem, where a GoogleLogger variant of FluentLogger exists for use in Google's codebase.

Getting started

Add com.google.flogger:flogger and com.google.flogger:flogger-system-backend as dependencies, with the system backend needed only at runtime by the module that builds the app or binary. Then import com.google.common.flogger.FluentLogger, create a private static final FluentLogger logger = FluentLogger.forEnclosingClass();, and either rely on the transitive binding or pick a backend such as the SLF4J one.

How it compares

The facts provided do not name any paid products that Flogger replaces, and they do not name any specific competing open-source logging API either, so it stands alone in this registry rather than sitting in a documented comparison set. What the facts do establish is a contrast against the alternatives in general terms: the Java Core Libraries Team, the Guava maintainers, concluded that Flogger was not slightly better than those alternatives but much better. That conclusion is the basis for Flogger being the sole recommended Java logging API within Google.

When to use it — and when not to

A self-hoster is not operating a service here, since Flogger is a library that ships as Maven artifacts, so the operational burden falls on selecting and configuring a backend and keeping the runtime dependency on flogger-system-backend wired into the built binary. Avoid it if the project is not Java, if the team is unwilling to leave an existing logging API behind, or if the fluent style is unwanted. Note also that the registry record is honest about maturity signals rather than feature gaps: 53 open issues, but an active codebase with a last push in September 2026, a maintained homepage, and published Javadocs and CI badges.

project readme (upstream, from github) — read inline

Flogger: A Fluent Logging API for Java

Maven Central Javadocs CI

What is it?

Flogger is a fluent logging API for Java. It supports a wide variety of features, and has many benefits over existing logging APIs.

Come for more self-documenting log statements:

logger.atInfo().withCause(exception).log("Log message with: %s", argument);

Stay for additional features that help you manage your logging better:

logger.atSevere()
    .atMostEvery(30, SECONDS)
    .log("Value: %s", lazy(() -> doExpensiveCalculation()));

Benefits

While some users prefer "fluency" as a style, this is not what the argument for Flogger rests on. Flogger offers these key, concrete advantages over other logging APIs:

  • Logging at disabled levels is effectively free. Finally, you can add as many fine-grained log statements to your code as you want, without worry.
  • Flogger also has very high performance for enabled log statements.
  • A fluent API accommodates a variety of present and future features without combinatorial explosion, and without requiring separate logging façades.
  • Less reliance on long parameter lists makes it harder to misuse and yields more self-documenting code.

Yet another logging API?

The field of open-source Java logging APIs is already extremely crowded, so why add another?

To paraphrase Douglas Adams "Google's codebase is big. Really big. You just won’t believe how vastly hugely mind-bogglingly big it is". Inevitably this resulted in many different debug logging APIs being used throughout the Java codebase, each with its own benefits and issues. Developers were forced to switch between APIs as they worked on different projects, and differences between APIs caused confusion and bugs.

Flogger is the result of an attempt to create a unified logging API, suitable for the vast majority of Java projects in Google.

For something of this magnitude it would have been preferable to use an existing logging API, rather than creating and maintaining our own. However, the Java Core Libraries Team (i.e. Guava maintainers) concluded that Flogger was not slightly better than the alternatives, but much better.

By switching the majority of Java code in Google to use Flogger, many thousands of bugs have been fixed and the cost to developers of learning new logging APIs as they move through the codebase has been eliminated. Flogger is now the sole recommended Java logging API within Google.

How to use Flogger

1. Add the dependencies on Flogger

All code that uses flogger should depend on com.google.flogger:flogger: and com.google.flogger:flogger-system-backend:.

Note: the dependency on flogger-system-backend is only required to be included when the binary is run. If you have a modularized build, you can include this dependency by the root module that builds your app/binary, and can be runtime scope.

2. Add an import for FluentLogger

import com.google.common.flogger.FluentLogger;

3. Create a private static final instance

private static final FluentLogger logger = FluentLogger.forEnclosingClass();

4. Start logging:

logger.atInfo().withCause(exception).log("Log message with: %s", argument);

Log messages can use any of Java's printf format specifiers; such as %s, %d, %016x etc.

Note that you may also see code and documentation that references the GoogleLogger class. This is a minor variant of the default FluentLogger designed for use in Google's codebase. The FluentLogger API is recommended for non-Google code, since its API should remain more stable over time.

More information

Flogger was designed and implemented by David Beaumont, with invaluable help from the Java Core Libraries Team and many other Googlers.

If you interested in a deeper dive into the rationale behind Flogger's API, please see Anatomy of an API.

Frequently asked questions

Is flogger free to use?

flogger is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does flogger do?

A Fluent Logging API for Java

What is flogger written in?

flogger is primarily written in Java. Its source is publicly available at https://github.com/google/flogger, and it has 1,481 GitHub stars.