Class HttpRequestMonitorAndLog

java.lang.Object
net.targetr.rc.monitoring.logs.http.HttpRequestMonitor
net.targetr.rc.monitoring.logs.http.HttpRequestMonitorAndLog

public class HttpRequestMonitorAndLog extends HttpRequestMonitor
Monitors HTTP requests, dispatches them to active WebSocket monitoring sessions, and writes them to a daily log file in log/[yyyy-MM-dd]/http.log.

Entries are queued in memory and flushed to disk every 10 seconds by a background daemon thread. A JVM shutdown hook flushes any remaining entries.

  • Constructor Details

    • HttpRequestMonitorAndLog

      public HttpRequestMonitorAndLog()
      Constructs a new HttpRequestMonitorAndLog. Starts a daemon thread that flushes queued entries to disk every 10 seconds and registers a shutdown hook to flush remaining entries on JVM exit.
  • Method Details

    • notify

      public void notify(HttpRequestLogEntry entry)
      Queues the entry for background logging and notifies WebSocket sessions.
      Overrides:
      notify in class HttpRequestMonitor
      Parameters:
      entry - the request log entry
    • isListening

      public boolean isListening()
      Returns true, always log.
      Overrides:
      isListening in class HttpRequestMonitor
      Returns:
      true always