whoami

Lucas Jenß

cat /etc/motd

The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.

Close-up of white dominoes with black dots standing on green felt surface, shallow depth of field, focused mood

ls -la ~/languages/

total 8
drwxr-xr-x
▶ PHP
▶ Ruby
▶ Scala
▶ C#
▶ JavaScript
▶ Objective-C
▶ Shell Scripting

ls -la ~/toolchain/

total 7
drwxr-xr-x
▶ Typo3
▶ Akka
▶ Capistrano
▶ Git
▶ MAMP
▶ Adobe Illustrator
▶ NSTrackingArea (Cocoa)

uname -a

platforms
drwxr-xr-x
▶ Mac OS X
▶ Unix

Filter Akka Library Actor Noise with Logback

Akka applications often look healthy until a noisy dependency fills every test run with debug output. The culprit may be an actor inside a third-party library, but the setting that controls it usually belongs to the SLF4J and Logback layer rather than to the actor itself. Keeping those boundaries clear stops a legitimate warning from disappearing with the chatter.

Configuring Akka Logback to filter noisy debug messages from library actors starts with identifying the logger carrying the event. The aim is a narrow namespace rule, not a global shutdown of useful diagnostics. I keep notes in this style because configuration surprises recur across projects, and this Coding Journal focuses on fixes that survive a real release.

Trace the source of noisy messages

Akka's logging path has two common branches. Code using the Akka Logging API sends a LogEvent through the actor system's event stream and eventually reaches SLF4J; dependency code may call SLF4J directly. The first branch can be influenced by akka.loglevel, while the second is normally governed by a logger name and its position in the Logback hierarchy.

Capture one representative burst before changing anything. A temporary pattern such as the following exposes the logger, thread and, where available, Akka source metadata:

%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{48} %X{akkaSource} - %msg%n

The useful clue is usually the logger namespace, not the actor's display name. A name such as com.vendor.messaging indicates that a rule on that parent will cover its child packages. If every line reports akka.event.slf4j.Slf4jLogger, the source has been routed through Akka, and a package logger alone may not distinguish it; inspect the source metadata or use an Akka-side filter as described below. I first found this distinction while comparing logs from an untouched dependency; another project-focused site with the same evidence-first style is The BiPalace.

Establish a baseline for application logs

Start with a service-wide baseline that suits your own code, then make exceptions for noisy dependencies. In the HOCON application.conf of a Scala service, this keeps normal Akka event-stream logging at INFO and aligns the stdout level so a debug stream is not duplicated there:

akka {
  loglevel = "INFO"
  stdout-loglevel = "INFO"
  logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
  loggers = ["akka.event.slf4j.Slf4jLogger"]
}

The akka.loglevel setting is deliberately broader than a single library. It prevents DEBUG events submitted through Akka from reaching the backend, which is useful when the source cannot be separated by logger name. It does not, by itself, change a third-party library's own SLF4J logger, so keep the baseline and apply the narrower Logback rules separately.

If a custom akka.logging-filter already exists, review it before assuming this setting is active. A filter that rejects events earlier in the pipeline can change the outcome, while OFF should be reserved for a dependency that is genuinely unusable at any level.

Target the affected library namespace

Logback resolves logger names from the most specific match upward, making the package boundary the safest place to begin. Set the application root to INFO, give the noisy dependency WARN, and add the appender only at the root so matching events still reach normal console or file output:

<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{40} - %msg%n</pattern>
    </encoder>
  </appender>

  <logger name="com.vendor.messaging" level="INFO"/>
  <logger name="com.vendor.noisy" level="WARN"/>

  <root level="INFO">
    <appender-ref ref="CONSOLE"/>
  </root>
</configuration>

Leave additivity enabled unless the library logger has its own appender. When it is enabled, the root appender receives the accepted event once; disabling it without adding another appender can make the library disappear entirely. Use the narrowest namespace that contains the noisy class, and confirm child packages inherit the intended level.

A ThresholdFilter on an appender is a fallback, not the first choice. It operates after routing and can also remove low-level events from other sources sharing that appender. A TurboFilter or custom Akka LoggingFilter is appropriate when matching by event source is unavoidable, but both affect filtering earlier and require focused tests.

Test the filter with production-like traffic

A filter is not proven by a tidy unit test that never starts the offending actor. Run the scenario that produced the noise, capture the same appender used by the service, and assert both sides of the boundary: the library's DEBUG line is absent, while its warning or error and an unrelated application INFO event remain.

Dead-letter warnings need separate treatment because an unhandled message can represent a genuine contract failure. The pattern in this dead letter warning guide explains how to recognise it and distinguish it from disposable debug chatter. Preserve those diagnostics, and avoid hiding a dead-letter warning merely to make a deployment look quieter.

Australian teams should also compare timestamps in UTC before interpreting a burst. Perth remains on Australian Western Standard Time, while Sydney and Melbourne move between Australian Eastern Standard Time and Australian Eastern Daylight Time. The gap is normally two hours and becomes three during daylight saving, which can make identical log sequences appear out of order during an overnight handover with a global team.

Keep deployments observable and reversible

Configuration can work in development and fail in production because Logback reads the first matching resource on the classpath. Check for logback-test.xml, shaded or duplicate logback.xml files, and framework-specific defaults. Log the resolved configuration path at startup in a controlled internal event, or verify it with a configuration endpoint, so a packaged artifact does not silently use a different policy.

Treat a logging change like any other production change: ship it to a small environment, compare event rates by logger, and retain the previous XML for a quick rollback. A useful check is to compare accepted events at INFO and above before and after deployment. If a critical error disappears at the same time, restore the narrower rule rather than raising the root level.

The Australian market includes managed logging providers with local business-hours support as well as global services with round-the-clock cover. Confirm whether escalation follows Sydney and Melbourne hours, particularly around the daylight-saving transition, and put the agreed support path beside the runbook. Readers who want publication and contact details can find them on the journal's imprint page.

Choose a durable logging configuration

The practical choice depends on where the event enters the logging pipeline. A package logger is the least disruptive option; an Akka-wide level is simpler but broader; destination filters should be reserved for shared outputs; and early filters require extra care:

Approach Scope Best use Main caution
Logback logger level One package or class A known noisy dependency An incorrect name leaves the source unchanged
akka.loglevel Akka event stream Debug events whose source cannot be isolated Also hides useful application debug events
akka.stdout-loglevel Akka stdout logger Removing a duplicate stdout stream It does not control file or other SLF4J appenders
Appender ThresholdFilter One destination Enforcing a minimum level on shared output It can suppress events from unrelated sources
TurboFilter or custom LoggingFilter Early, often global filtering Source or message-specific exceptions More complexity and a greater blast radius

For most services, keep the root at INFO, raise only the confirmed library logger, and use akka.loglevel as a fallback for Akka-routed events with no dependable source name. Document the chosen level next to the dependency version; a library upgrade can change packages or logging behaviour. Keep the rule in source control with the application configuration, rather than relying on a dashboard setting that a new deployment can overwrite.

Open the current logback.xml, identify one logger that emits the noisy debug stream, add the narrowest justified level rule, and rerun the failing scenario. Record the logger name, retained levels and rollback command so the next Sydney or Melbourne deployment begins with evidence rather than another broad suppression.


cat ~/interests.json

KeyValue
editorTerminal-first workflow
osMac OS X / Unix
vcsGit, distributed version control
deployCapistrano, cron automation
graphicsSVG, Adobe Illustrator troubleshooting
networkingIP validation, SSH, VPN

git log --oneline --reverse

2013-10-30

Solving SVG import issues in Adobe Illustrator CS6 and CC

When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.

2013

Solving NDK build issues on OS X

Troubleshooting native development kit compilation problems on Mac OS X.

2013

Programmatically adding PHP generated TypoScript to the backend configuration

Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.

2013

ArgumentError: Could not parse PKey: no start line

Debugging an SSH key parsing error encountered during deployment.

2011-08-04

Validating IP-Addresses in PHP

Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.

2011-07-09

Cocoa: Using NSTrackingArea

A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.


cat ~/contact.txt

github: github.com/x3ro
stackoverflow: x3ro
coderwall: coderwall.com/x3ro
twitter: @x3rames