cz.cuni.amis.pogamut.base.utils.logging
Interface ILogPublisher

All Known Implementing Classes:
JMXLogPublisher, LogPublisher, LogPublisher.ConsolePublisher, LogPublisher.FilePublisher, NetworkLogPublisher

public interface ILogPublisher

Java logging API relies on handlers for publishing records, we have created one instance of this Handler (LogHandler instnace) and delegate abstract methods from Handler on the publisher interface.

Default implementation LogPublisher exists which is using Formatter to format the LogRecord - inside this LogPublisher you will find public static inner class with default implementation for publishing log records to Console or File (LogPublisher.ConsolePublisher and LogPublisher.FilePublisher classes).


Method Summary
 void close()
          From JavaDoc API:
 void flush()
          From JavaDoc API:
 void publish(java.util.logging.LogRecord record)
          From JavaDoc API:
 

Method Detail

publish

void publish(java.util.logging.LogRecord record)
From JavaDoc API:

Publish a LogRecord.

The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.

The Handler is responsible for formatting the message, when and if necessary. The formatting should include localization.


Parameters:
record - description of the log event. A null record is silently ignored and is not published

flush

void flush()
From JavaDoc API:

Flush any buffered output.


close

void close()
           throws java.lang.SecurityException
From JavaDoc API:

Close the Handler and free all associated resources.

The close method will perform a flush and then close the Handler. After close has been called this Handler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.

Throws:
java.lang.SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control").