Budget Aware Logging

There are instances where loggers may be overly chatty, and will log more than necessary. Rather than hunt down all the individual loggers and whitelist or blacklist the lot of them, you may want to assign a budget that will budget INFO messages to 5 statements a second.

This is easy to do with the logback-budget module, which uses an internal circuit breaker to regulate the flow of messages.


    <newRule pattern="*/budget-rule"

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
            <evaluator class="com.tersesystems.logback.budget.BudgetEvaluator">
              <budget-rule name="INFO" threshold="5" interval="1" timeUnit="seconds"/>

            <pattern>%-5relative %-5level %logger{35} - %msg%n</pattern>

    <root level="TRACE">
        <appender-ref ref="STDOUT"/>


See Application Logging in Java: Filters for more details.