Class MultiplexerLogHandler
java.lang.Object
java.util.logging.Handler
com.scivicslab.turingworkflow.plugins.logoutput.MultiplexerLogHandler
A java.util.logging Handler that forwards log messages to MultiplexerAccumulatorActor.
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.
- Since:
- 1.0
- Author:
- devteam@scivicslab.com
-
Constructor Summary
ConstructorsConstructorDescriptionMultiplexerLogHandler(com.scivicslab.turingworkflow.workflow.IIActorSystem system) Constructs aMultiplexerLogHandlerthat forwards log records to theoutputMultiplexeractor within the given actor system. -
Method Summary
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Constructor Details
-
MultiplexerLogHandler
public MultiplexerLogHandler(com.scivicslab.turingworkflow.workflow.IIActorSystem system) Constructs aMultiplexerLogHandlerthat forwards log records to theoutputMultiplexeractor within the given actor system.- Parameters:
system- the actor system containing theoutputMultiplexeractor
-
-
Method Details
-
publish
Publishes a log record by formatting it as an ISO 8601 timestamped message and forwarding it to theoutputMultiplexeractor via theaddaction.The log entry is sent with:
source- a short name derived from the logger name (e.g.,"turing-workflow","pojo-actor", or the simple class name)type-"log-"followed by the log level name (e.g.,"log-INFO","log-SEVERE")data- the formatted log message including timestamp, level, and optional stack trace
If the handler is closed, the record is
null, or theoutputMultiplexeractor is not registered, the record is silently discarded. -
flush
public void flush()No-op flush. Log entries are forwarded immediately onpublish(java.util.logging.LogRecord). -
close
Closes this handler. After closing, subsequent calls topublish(java.util.logging.LogRecord)will silently discard log records.- Specified by:
closein classHandler- Throws:
SecurityException- if a security manager denies the operation
-