Class SyslogService

java.lang.Object
java.util.logging.Handler
org.openremote.manager.syslog.SyslogService
All Implemented Interfaces:
org.openremote.model.ContainerService

public class SyslogService extends Handler implements org.openremote.model.ContainerService
Act as a JUL handler, publishes (some) log messages on the client event bus, stores (some, depending on SyslogConfig) log messages in the database.
  • Field Details

    • OR_SYSLOG_LOG_LEVEL

      public static final String OR_SYSLOG_LOG_LEVEL
      See Also:
    • OR_SYSLOG_LOG_LEVEL_DEFAULT

      public static final org.openremote.model.syslog.SyslogLevel OR_SYSLOG_LOG_LEVEL_DEFAULT
    • OR_SYSLOG_MAX_AGE_DAYS

      public static final String OR_SYSLOG_MAX_AGE_DAYS
      See Also:
    • OR_SYSLOG_MAX_AGE_DAYS_DEFAULT

      public static final int OR_SYSLOG_MAX_AGE_DAYS_DEFAULT
      See Also:
    • scheduledExecutorService

      protected ScheduledExecutorService scheduledExecutorService
    • persistenceService

      protected org.openremote.container.persistence.PersistenceService persistenceService
    • clientEventService

      protected ClientEventService clientEventService
    • config

      protected org.openremote.model.syslog.SyslogConfig config
    • batch

      protected final List<org.openremote.model.syslog.SyslogEvent> batch
    • flushBatchFuture

      protected ScheduledFuture flushBatchFuture
    • deleteOldFuture

      protected ScheduledFuture deleteOldFuture
  • Constructor Details

    • SyslogService

      public SyslogService()
  • Method Details

    • getPriority

      public int getPriority()
      Specified by:
      getPriority in interface org.openremote.model.ContainerService
    • init

      public void init(org.openremote.model.Container container) throws Exception
      Specified by:
      init in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • start

      public void start(org.openremote.model.Container container) throws Exception
      Specified by:
      start in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • purgeSyslog

      protected void purgeSyslog()
    • stop

      public void stop(org.openremote.model.Container container) throws Exception
      Specified by:
      stop in interface org.openremote.model.ContainerService
      Throws:
      Exception
    • flush

      public void flush()
      Specified by:
      flush in class Handler
    • close

      public void close() throws SecurityException
      Specified by:
      close in class Handler
      Throws:
      SecurityException
    • publish

      public void publish(LogRecord record)
      Specified by:
      publish in class Handler
    • setConfig

      public void setConfig(org.openremote.model.syslog.SyslogConfig config)
    • getConfig

      public org.openremote.model.syslog.SyslogConfig getConfig()
    • clearStoredEvents

      public void clearStoredEvents()
    • getEvents

      public org.openremote.model.util.Pair<Long,List<org.openremote.model.syslog.SyslogEvent>> getEvents(org.openremote.model.syslog.SyslogLevel level, int perPage, int page, Instant from, Instant to, List<org.openremote.model.syslog.SyslogCategory> categories, List<String> subCategories)
    • store

      protected void store(org.openremote.model.syslog.SyslogEvent syslogEvent)
    • flushBatch

      protected void flushBatch()
    • toString

      public String toString()
      Overrides:
      toString in class Object