Package akka.javasdk
Interface LogSanitizer
public interface LogSanitizer
A log sanitizer masks the sensitive parts of a log message.
The runtime calls it for every log line of the service, including the runtime's own. Keep an * implementation fast and self-contained: a pure function of the message and its configuration. Do not log from it.
An implementation has one public constructor, which takes no parameter or a SanitizerContext for the sanitizer's configured name and config section.
A class can implement both this interface and TextSanitizer, to mask log messages and
the text of agents with the same logic. It is then constructed as a log sanitizer.
Log sanitizers are enabled with configuration; see sanitization documentation.
-
Method Summary
-
Method Details
-
sanitize
Returnsmessagewith its sensitive parts masked, ormessageitself when there is nothing to mask.When this method throws, the runtime replaces the log message with the reason and writes the event at warning level or higher.
- Returns:
- the masked message
-