Class DefaultLogger

  • All Implemented Interfaces:
    AuditListener, Configurable, Contextualizable, java.util.EventListener

    public class DefaultLogger
    extends AutomaticBean
    implements AuditListener
    Simple plain logger for text output. This is maybe not very suitable for a text output into a file since it does not need all 'audit finished' and so on stuff, but it looks good on stdout anyway. If there is really a problem this is what XMLLogger is for. It gives structure.
    See Also:
    XMLLogger
    • Constructor Detail

      • DefaultLogger

        public DefaultLogger​(java.io.OutputStream outputStream,
                             AutomaticBean.OutputStreamOptions outputStreamOptions)
        Creates a new DefaultLogger instance.
        Parameters:
        outputStream - where to log audit events
        outputStreamOptions - if CLOSE that should be closed in auditFinished()
      • DefaultLogger

        public DefaultLogger​(java.io.OutputStream infoStream,
                             AutomaticBean.OutputStreamOptions infoStreamOptions,
                             java.io.OutputStream errorStream,
                             AutomaticBean.OutputStreamOptions errorStreamOptions)
        Creates a new DefaultLogger instance.
        Parameters:
        infoStream - the OutputStream for info messages.
        infoStreamOptions - if CLOSE info should be closed in auditFinished()
        errorStream - the OutputStream for error messages.
        errorStreamOptions - if CLOSE error should be closed in auditFinished()
      • DefaultLogger

        public DefaultLogger​(java.io.OutputStream infoStream,
                             AutomaticBean.OutputStreamOptions infoStreamOptions,
                             java.io.OutputStream errorStream,
                             AutomaticBean.OutputStreamOptions errorStreamOptions,
                             AuditEventFormatter messageFormatter)
        Creates a new DefaultLogger instance.
        Parameters:
        infoStream - the OutputStream for info messages
        infoStreamOptions - if CLOSE info should be closed in auditFinished()
        errorStream - the OutputStream for error messages
        errorStreamOptions - if CLOSE error should be closed in auditFinished()
        messageFormatter - formatter for the log message.
        Throws:
        java.lang.IllegalArgumentException - if stream options are null