Class HttpRequestMonitorAndLog
java.lang.Object
net.targetr.rc.monitoring.logs.http.HttpRequestMonitor
net.targetr.rc.monitoring.logs.http.HttpRequestMonitorAndLog
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true, always log.voidnotify(HttpRequestLogEntry entry) Queues the entry for background logging and notifies WebSocket sessions.Methods inherited from class net.targetr.rc.monitoring.logs.http.HttpRequestMonitor
attach, detach
-
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
Queues the entry for background logging and notifies WebSocket sessions.- Overrides:
notifyin classHttpRequestMonitor- Parameters:
entry- the request log entry
-
isListening
public boolean isListening()Returns true, always log.- Overrides:
isListeningin classHttpRequestMonitor- Returns:
- true always
-