Class JulLog
- All Implemented Interfaces:
LogInterface
LogInterface that routes every message to
java.util.logging (JUL), the logging framework built into the JDK. Unlike the
historical JavaLog (shipped separately so the library could stay Java 1.2/1.3
compatible), this backend lives directly in com.mcpdbwizard.pub and needs no extra jar —
JUL is part of the JDK.
The five LogInterface severities map onto JUL levels as follows. JUL has no level above
SEVERE, so both error and syserror use it:
LogInterface | java.util.logging.Level |
|---|---|
debug | FINE |
info | INFO |
warning | WARNING |
error | SEVERE |
syserror | SEVERE |
The isModal and isLogged flags carried by the detailed LogInterface
methods are accepted and ignored: JUL has no modal-dialog concept, and whether a message is
actually written is decided by the JUL configuration (usually
$JAVA_HOME/conf/logging.properties), not by this class. Debug messages additionally
honour GenericLog.debugOn() / GenericLog.debugOff() (off by default), matching the other
LogInterface implementations. If debug messages are not appearing, check the JUL
configuration for a .level entry and set it to FINE or ALL.
The exception-taking error/syserror methods pass the Throwable straight
to JUL, so the handler records the full stack trace rather than just the message text.
See LogInterface
Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)
- Version:
- 7
- Author:
- [email protected]
-
Field Summary
Fields inherited from class com.mcpdbwizard.pub.GenericLog
autoFlush, autoLog, debugMessagesPrinted, LOG_BEING_FLUSHED, printThreadIdFields inherited from interface com.mcpdbwizard.pub.LogInterface
DEBUG, DEFAULT_FIELD_DELIMITER, DEFAULT_FILENAME_DAY_FORMAT, DEFAULT_FILENAME_TIME_FORMAT, DEFAULT_TIME_FORMAT_STRING, ERROR, INFO, SYSERR, WARN -
Constructor Summary
ConstructorsConstructorDescriptionJulLog()Create an instance ofJulLogbacked by a logger named after this class.Create an instance ofJulLogbacked by a logger named after the given class.Create an instance ofJulLogbacked by a logger with the given name.Create an instance ofJulLogthat wraps an existing JUL logger. -
Method Summary
Modifier and TypeMethodDescriptionvoidLog an error atSEVERE, passing the exception to JUL so the full stack trace is recorded.voidflush()Required byLogInterfacebut not used: JUL handlers manage their own flushing.Returns the name of the JUL logger messages are routed through.Return the underlying JUL logger.voidLog a serious error atSEVERE, passing the exception to JUL so the full stack trace is recorded.protected voidwriteMessage(String messageType, String messageText, boolean isModal, boolean isLogged) Route a formatted message to the JUL level that corresponds to its severity.Methods inherited from class com.mcpdbwizard.pub.GenericLog
debug, debug, debugOff, debugOn, error, error, error, formatMessage, getDateFormat, getDebug, info, info, setAutoFlush, setAutoLog, syserror, syserror, syserror, warning, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mcpdbwizard.pub.LogInterface
debug, debug, debugOff, debugOn, error, error, error, getDateFormat, getDebug, info, info, setAutoFlush, setAutoLog, syserror, syserror, syserror, warning, warning
-
Constructor Details
-
JulLog
public JulLog()Create an instance ofJulLogbacked by a logger named after this class. -
JulLog
Create an instance ofJulLogbacked by a logger with the given name.- Parameters:
loggerName- the JUL logger name to use. This should be a dot-separated name, normally based on the package or class name of the subsystem.
-
JulLog
Create an instance ofJulLogbacked by a logger named after the given class.- Parameters:
clazz- the class whose name is used as the JUL logger name.
-
JulLog
-
-
Method Details
-
getLogger
-
writeMessage
protected void writeMessage(String messageType, String messageText, boolean isModal, boolean isLogged) Route a formatted message to the JUL level that corresponds to its severity. JUL applies its own level filtering, so a message emitted here may still be discarded downstream.- Specified by:
writeMessagein classGenericLog- Parameters:
messageType- one of theDEBUG,INFO,WARN,ERRORorSYSERRconstants defined inLogInterface.messageText- the message text.isModal- ignored; JUL has no modal-dialog concept.isLogged- ignored; the JUL configuration decides what is written.
-
error
Log an error atSEVERE, passing the exception to JUL so the full stack trace is recorded.- Specified by:
errorin interfaceLogInterface- Overrides:
errorin classGenericLog- Parameters:
theException- the exception to log.isModal- ignored; JUL has no modal-dialog concept.isLogged- ignored; the JUL configuration decides what is written.
-
syserror
Log a serious error atSEVERE, passing the exception to JUL so the full stack trace is recorded.- Specified by:
syserrorin interfaceLogInterface- Overrides:
syserrorin classGenericLog- Parameters:
theException- the exception to log.isModal- ignored; JUL has no modal-dialog concept.isLogged- ignored; the JUL configuration decides what is written.
-
flush
public void flush()Required byLogInterfacebut not used: JUL handlers manage their own flushing.- Specified by:
flushin interfaceLogInterface- Specified by:
flushin classGenericLog
-
getCurrentLog
Returns the name of the JUL logger messages are routed through.- Specified by:
getCurrentLogin interfaceLogInterface- Specified by:
getCurrentLogin classGenericLog- Returns:
- the JUL logger name (not a file path; the actual destination is determined by the JUL configuration and its handlers).
-