Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

logcenter

Centralized log collector for a node. Every yuno ships its log records to logcenter over UDP (the peer of the kernel’s to_udp log handler, default udp://127.0.0.1:1992). logcenter counts them by priority, writes them to size/disk-guarded rotatory files, aggregates a summary report, watches free disk/memory, and can e-mail the report or even restart the node on a queue alarm.

Architecture

C_LOGCENTER            <- counting, rotation, summary, monitoring, self-heal
    > C_GSS_UDP_S      <- UDP server (udp://127.0.0.1:1992), receives log records
    > C_TIMER          <- periodic disk/memory monitor

Summary e-mails are sent by publishing EV_SEND_EMAIL to the emailsender service (see emailsender).

Wire format

Each UDP datagram from the to_udp handler is:

<priority:1 char><sequence:8 hex><message bytes...><crc:8 hex>

logcenter verifies the trailing CRC, tracks the sequence (gaps are only logged under the debug trace), strips both, then files the message. If the message body is JSON ({...}) it is also folded into the summary tree.

What it does with each record

  1. Counts it by syslog priority — Alert, Critical, Error, Warning, Info, Debug, Audit, Monitor.

  2. Writes it to a rotatory log file under the yuno’s logs/ directory, named from log_filename (mask DD/MM/CCYY-W-ZZZ). Rotation is bounded by max_rotatoryfile_size and pauses when free disk drops below min_free_disk.

  3. Aggregates JSON records into a summary grouped by msgsetmsg → count (separately for errors, warnings, infos).

Configuration

Inspect the effective config at runtime with ycommand command-yuno id=<id> service=__yuno__ command=view-config.

AttributeDefaultPurpose
urludp://127.0.0.1:1992UDP server to receive log records
from(required)From address for the summary e-mail
to(required)Recipient(s) of the summary e-mail (,/; separated)
subjectLog Center SummarySummary e-mail subject
log_filenameW.logRotatory file name (mask DD/MM/CCYY-W-ZZZ)
max_rotatoryfile_size600Max log file size (MB) before rotating
rotatory_bf_size10Rotatory write buffer (MB)
min_free_disk20Stop writing / warn below this % free disk
min_free_mem20Warn below this % free RAM
send_summary_disabledfalseSuppress summary e-mails
restart_on_alarmfalseRun restart_yuneta_command on a queue alarm
restart_yuneta_commandyshutdown … ; yuneta_agent --start …Command run on alarm
queue_restart_limit0Only restart if reported queue_size ≥ this (cmd enforces ≥ 10000)
timeout_restart_yuneta3600Min seconds between restarts (must be ≥ 3600)
timeout1000Monitor tick (ms)

Commands

CommandParametersDescription
display-summaryReturn the summary report (includes internal errors)
send-summaryE-mail the summary report now (via emailsender)
enable-send-summary / disable-send-summaryToggle send_summary_disabled
reset-countersZero the priority counters and summary trees
searchtext, maxcountSearch the stored log records
taillinesOutput the last lines log records (default 100)
restart-yuneta-on-queue-alarmenable, queue_restart_limit, timeout_restart_yunetaConfigure the queue-alarm self-heal
helpcmd, levelCommand help

The summary report (from display-summary / send-summary) looks like:

{
    "Global Counters": { "Alert": 0, "Critical": 0, "Error": 2, "Warning": 39, "Info": 1185, "Debug": 1937, "Audit": 0, "Monitor": 0 },
    "Node Owner": "artgins",
    "Global Errors":   { "App": { "email NOT sent": 1 }, "Liburing": { "getaddrinfo() FAILED": 1 } },
    "Global Warnings": { "Info": { "No authz db, authz only to local access": 1 } },
    "Global Infos":    { "Connect Disconnect": { "Connected": 295, "Disconnected": 386 } }
}

Monitoring & self-heal

Debugging

GClassLevelShows
C_LOGCENTERdebugCRC/sequence mismatches on incoming datagrams

Enable with ycommand command-yuno id=<id> service=__yuno__ command=set-gclass-trace gclass=C_LOGCENTER set=1 level=debug.