Class MultiplexerLogHandler
java.lang.Object
java.util.logging.Handler
com.scivicslab.actoriac.accumulator.MultiplexerLogHandler
A java.util.logging Handler that forwards log messages to MultiplexerAccumulatorIIAR.
This handler bridges java.util.logging with the MultiplexerAccumulator system, allowing all log messages to be captured in the same output destinations (console, file, database) as command output and cowsay.
Log Format
Log messages are formatted as:
2026-01-17T12:27:54+09:00 INFO Starting workflow: main-collect-sysinfo
Message Format
Messages sent to MultiplexerAccumulator:
{
"source": "cli",
"type": "log-INFO",
"data": "2026-01-17T12:27:54+09:00 INFO Starting workflow: main-collect-sysinfo"
}
Usage
// After registering MultiplexerAccumulatorIIAR
MultiplexerLogHandler logHandler = new MultiplexerLogHandler(system);
Logger.getLogger("").addHandler(logHandler);
- Since:
- 2.12.0
- Author:
- devteam@scivicslab.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final DateTimeFormatterprivate final com.scivicslab.pojoactor.workflow.IIActorSystemprivate static final ZoneId -
Constructor Summary
ConstructorsConstructorDescriptionMultiplexerLogHandler(com.scivicslab.pojoactor.workflow.IIActorSystem system) Constructs a MultiplexerLogHandler. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()private StringformatMessage(LogRecord record) Formats the log message, including any throwable if present.private StringgetSourceName(LogRecord record) Determines the source name from the log record.voidMethods inherited from class Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Field Details
-
ISO_FORMATTER
-
SYSTEM_ZONE
-
system
-
closed
-
-
Constructor Details
-
MultiplexerLogHandler
Constructs a MultiplexerLogHandler.- Parameters:
system- the actor system to retrieve outputMultiplexer from
-
-
Method Details
-
publish
-
formatMessage
Formats the log message, including any throwable if present. -
getSourceName
Determines the source name from the log record. -
flush
-
close
- Specified by:
closein classHandler- Throws:
SecurityException
-