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.Handler
This 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 void
close()
void
finalize()
void
flush()
Facility
getFacility()
Returns thesyslog
facility to be logged to.java.lang.String
getIdent()
Returns thesyslog(3C)
ident string, which is prepended to every message.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.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.void
setFormatter(java.util.logging.Formatter formatter)
Formatters may not be used with SyslogHandler.java.lang.String
toString()
-
-
-
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:
finalize
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
publish
in classjava.util.logging.Handler
-
flush
public void flush()
- Specified by:
flush
in classjava.util.logging.Handler
-
close
public void close() throws java.lang.SecurityException
- Specified by:
close
in 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:
setFormatter
in 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 thesyslog
facility to be logged to.
-
-