8000 Implement real-time log monitoring system with TCP ingestion and Vue3 UI by Copilot · Pull Request #1 · devuser/goMemoryLogMonitor · GitHub
[go: up one dir, main page]

Skip to content

Conversation

Copy link
Copilot AI commented Jan 28, 2026

Built a lightweight log monitoring system with TCP ingestion (port 9090), HTTP API (port 8080), and embedded Vue3 frontend. Supports keyword/date filtering, sorting, pagination, and real-time updates.

Architecture

Backend (Go + Gin)

  • logstore: Thread-safe in-memory storage with sync.RWMutex, LRU eviction at 10k entries
  • tcp: Line-delimited log receiver with auto-timestamping
  • http: RESTful API + embedded frontend serving via embed.FS

Frontend (Vue3 + TypeScript + Vite)

  • Real-time log viewer with 5s auto-refresh
  • Filter controls (keyword, date range)
  • Sort/paginate controls
  • Built assets embedded in Go binary

API

# Get logs with filtering
GET /api/logs?keyword=error&start=2026-01-28T00:00:00Z&sort=desc&page=1&pageSize=50

# System status
GET /api/status

Implementation Details

  • Thread safety: RWMutex protects all LogStore operations
  • LRU eviction: Front-insert on add, back-remove on overflow
  • Graceful shutdown: http.Server.Shutdown() with 5s timeout
  • Frontend embedding: Vite builds to http/frontend/dist/, served via NoRoute handler

Screenshots

Main UI
image

Filtered view
image

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy tcp --destination-port 53 -j ACCEPT test /bin/test mazon_Root_CA_4.bash test /bin/test test -e C_RAIZ_FNMT-RCM_/run/containerd/io.containerd.runtime.v2.task/moby/732fd67f93198684cf9879a232203/usr/bin/chronyc test /home/dependabotjson bal_Root_GB_CA.piptables uby /home/dependabot-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-de54ba05f38a -j DROP elper '!/home/de-n1 git /opt/go/bin/testrefs/tags/v1.1.1 --global runtime-runc/mobcat-file k test -e 62cdee6.0 (dns block)
  • go.uber.org
    • Triggering command: /update-job-proxy /update-job-proxy tcp --destination-port 53 -j ACCEPT test /bin/test mazon_Root_CA_4.bash test /bin/test test -e C_RAIZ_FNMT-RCM_/run/containerd/io.containerd.runtime.v2.task/moby/732fd67f93198684cf9879a232203/usr/bin/chronyc test /home/dependabotjson bal_Root_GB_CA.piptables uby /home/dependabot-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-de54ba05f38a -j DROP elper '!/home/de-n1 git /opt/go/bin/testrefs/tags/v1.1.1 --global runtime-runc/mobcat-file k test -e 62cdee6.0 (dns block)
  • google.golang.org
    • Triggering command: /update-job-proxy /update-job-proxy tcp --destination-port 53 -j ACCEPT test /bin/test mazon_Root_CA_4.bash test /bin/test test -e C_RAIZ_FNMT-RCM_/run/containerd/io.containerd.runtime.v2.task/moby/732fd67f93198684cf9879a232203/usr/bin/chronyc test /home/dependabotjson bal_Root_GB_CA.piptables uby /home/dependabot-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-de54ba05f38a -j DROP elper '!/home/de-n1 git /opt/go/bin/testrefs/tags/v1.1.1 --global runtime-runc/mobcat-file k test -e 62cdee6.0 (dns block)
  • gopkg.in
    • Triggering command: /update-job-proxy /update-job-proxy tcp --destination-port 53 -j ACCEPT test /bin/test mazon_Root_CA_4.bash test /bin/test test -e C_RAIZ_FNMT-RCM_/run/containerd/io.containerd.runtime.v2.task/moby/732fd67f93198684cf9879a232203/usr/bin/chronyc test /home/dependabotjson bal_Root_GB_CA.piptables uby /home/dependabot-t test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-de54ba05f38a -j DROP elper '!/home/de-n1 git /opt/go/bin/testrefs/tags/v1.1.1 --global runtime-runc/mobcat-file k test -e 62cdee6.0 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

MemoryLogMonitor: Go+Vue3 real-time log monitor. TCP server (port 9090) receives logs, stores in-memory with LRU eviction. HTTP server (port 8080) serves Vue3 web UI. Features: date/keyword filters, sorting, pagination, status API. Thread-safe logstore with sync.RWMutex. Frontend embedded via Go embed. Stack: Gin, Vue3, TypeScript, Vite.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 28, 2026 03:35
Co-authored-by: devuser <1059999+devuser@users.noreply.github.com>
Co-authored-by: devuser <1059999+devuser@users.noreply.github.com>
… stdlib

Co-authored-by: devuser <1059999+devuser@users.noreply.github.com>
Copilot AI changed the title [WIP] Add MemoryLogMonitor for real-time log monitoring Implement real-time log monitoring system with TCP ingestion and Vue3 UI Jan 28, 2026
Copilot AI requested a review from devuser January 28, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0