Package com.sun.solaris.service.logging
Class SyslogHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- com.sun.solaris.service.logging.SyslogHandler
-
public final class SyslogHandler extends java.util.logging.HandlerThis handler outputs LogRecords withsyslog(3C)to the given facility with a severity translated by Level with a fixed table. Formatters are not used. Multiple SyslogHandlers may not be in concurrent use in one virtual machine.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidfinalize()voidflush()FacilitygetFacility()Returns thesyslogfacility to be logged to.java.lang.StringgetIdent()Returns thesyslog(3C)ident string, which is prepended to every message.static SyslogHandlergetInstance(java.lang.String ident, Facility facility)Return this virtual machine's instance of SyslogHandler, creating one which logs with the given identity to the given facility if necessary, unless an instance with a different identity or facility is already open, in which case an IllegalArgumentException is thrown.voidpublish(java.util.logging.LogRecord record)Publishes the given record with its associated Severity (or infers its severity with Severity.severityForLevel(), if another type of Level is used), if the result is non-null.voidsetFormatter(java.util.logging.Formatter formatter)Formatters may not be used with SyslogHandler.java.lang.StringtoString()
-
-
-
Method Detail
-
getInstance
public static SyslogHandler getInstance(java.lang.String ident, Facility facility)
Return this virtual machine's instance of SyslogHandler, creating one which logs with the given identity to the given facility if necessary, unless an instance with a different identity or facility is already open, in which case an IllegalArgumentException is thrown.- Throws:
java.lang.IllegalArgumentException- if the requested identity or facility differs from a previously-created instance.
-
finalize
public void finalize()
- Overrides:
finalizein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
publish
public void publish(java.util.logging.LogRecord record)
Publishes the given record with its associated Severity (or infers its severity with Severity.severityForLevel(), if another type of Level is used), if the result is non-null.- Specified by:
publishin classjava.util.logging.Handler
-
flush
public void flush()
- Specified by:
flushin classjava.util.logging.Handler
-
close
public void close() throws java.lang.SecurityException- Specified by:
closein classjava.util.logging.Handler- Throws:
java.lang.SecurityException
-
setFormatter
public void setFormatter(java.util.logging.Formatter formatter)
Formatters may not be used with SyslogHandler.- Overrides:
setFormatterin classjava.util.logging.Handler- Throws:
java.lang.IllegalArgumentException- if the use of one is attempted.
-
getIdent
public java.lang.String getIdent()
Returns thesyslog(3C)ident string, which is prepended to every message.
-
getFacility
public Facility getFacility()
Returns thesyslogfacility to be logged to.
-
-