feat: system monitoring and custom log monitoring #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Added log monitoring capabilities to the Telex server monitor with the following features:
System log analysis: Retrieves recent error entries from system logs (Windows Event Logs via
wevtutil
or Linuxjournalctl
for priority 3 errors from the last hour), providing a snapshot of OS-level issues.Error log monitoring: Continuously checks system logs for errors at regular intervals, tracking the latest error events with timestamps. Logs are sent to telex at an interval of 5mins.
Custom log file monitoring: Supports monitoring of user-specified log files (e.g.,
.telexMonitor/error.log
), reading the last 10 lines and detecting changes since the last check.Log pattern matching: Filters log entries using customizable regex patterns (defaults to "error" and "fail"), with dynamic updates via
setPatterns()
, to highlight critical messages.Output formatting: Presents log metrics in a structured format with timestamps and truncated messages