Pakkit.net
← Back to blog

Infrastructure

Your Router and Switch Are Log Sources Too

Network gear logs gain operational value when they leave the device, gain timestamps and identity, and join the same search and retention system as applications and servers.

  • Observability
  • Network Operations
  • Syslog
  • Log Aggregation
  • Infrastructure

Network gear becomes much easier to operate when logs leave the device, gain timestamps and identity, and join the same search and retention system as applications and servers. A switch or router that talks only to its own limited local storage becomes invisible the moment you need to correlate its view of an outage with what applications saw. The flip is worth the work: off-box logs let you answer “did the network actually fail or was it a cascade from somewhere else” in minutes instead of never.

Your Router and Switch Are Log Sources TooDiagram for Your Router and Switch Are Log Sources Too, mapping three design pressures to three review checkpointsFIELD MAPYour Router and Switch Are Log Sources TooDESIGN PRESSURESREVIEW CHECKPOINTS• off-device retention• source identity and clock synchroniza…• transport and loss tradeoffs• Off-device retention solves the stora…• Clock and identity have to be right a…• Transport and loss are operational tr…TURN ASSUMPTIONS INTO EVIDENCE
A compact map of the article’s design pressures and review checkpoints

Off-device retention solves the storage problem

Switch and router flash are small and precious. Most devices ship with enough on-box buffer for a few megabytes of logs before wrapping or dropping. That’s enough for a single device crisis but not for pattern-hunting or forensics that span hours. The second you delete a device and redeploy it, on-box logs vanish. An operator troubleshooting a week-old link flap has no trace.

Moving logs off the device to a central store—even a syslog server on the same LAN—gives you retention that survives device lifecycle changes and gives you time to notice patterns instead of just react to the current alert. Most network operators have seen a switch reboot coincide with an application outage, then spent days trying to prove the sequence because the device log was already gone. Off-box retention answers that question once.

Clock and identity have to be right at write time

A router log line with no timestamp or the wrong timestamp is worse than no log at all. If a device runs on an incorrect clock, its logs scatter across your timeline and become a search liability. When you query “what happened at 14:32 UTC,” a device running 40 minutes slow will not appear in results that matter.

Network devices need synchronized clocks before they produce logs worth keeping. NTP is table stakes. If a device does not sync its clock, it should not send logs off-box until it does—or you must assume every timestamp you see is suspect.

Source identity is equally critical. A log line that says “interface down” is useless without knowing which device and which interface. Every log entry must carry the source device’s stable identity—not its hostname if the hostname can change, but a serial number, MAC address, or other immutable label. When you search for events from a specific switch, you need to match on something that does not rename or reassign.

Transport and loss are operational tradeoffs

Syslog over UDP is the default because it is simple and generates no backpressure. A device that sends UDP does not wait for acknowledgment; if the network is saturated or the collector is slow, the device just drops log lines and moves on. That keeps the router’s CPU and memory predictable.

TCP syslog adds delivery guarantees but costs device resources. A router sending logs over TCP that blocks will hold them in a buffer; under high log volume or collector outages, that buffer fills and the device either drops logs or slows its own packet processing. You have to test which failure mode your router chooses.

In a small network, UDP loss is often acceptable because logs are verbose and a few drops do not erase patterns. On a congested link or during the outage you most want to debug, UDP can lose the very events that matter. Some operators run both UDP and TCP to the same collector: UDP provides low-latency “best effort” logs and TCP handles a bounded tail of reliable delivery.

The tradeoff is explicit: pick the transport based on how you can tolerate loss, not on what the vendor default is.

A minimal log-routing architecture

You do not need a log platform the size of your application infrastructure. A working network device log system needs:

  • A syslog receiver: listens on a standard port (514 UDP and/or 601 TCP), writes to disk or a time-series store, and restarts cleanly. A single small machine can handle many devices.
  • Device configuration: each device sends logs to the receiver’s IP and port; verify clock sync and source identity before you consider the connection live.
  • A search interface: at minimum, grep or a tool that can search logs by timestamp, device ID, and keyword. Many teams use the same log aggregator they use for applications; others run a dedicated syslog daemon and query files with standard Unix tools.
  • A retention policy: decide how long to keep. One month is often enough for pattern forensics; three months is safer if you have storage. When logs are old enough to drop, delete them.

Acceptance criteria checklist

Before calling network device logging “done,” verify:

  • Every device sends logs off-box to a receiver with a test from each device class (switch, router, access point) to confirm connectivity.
  • Device clock is synced to NTP. Spot-check a device log entry’s timestamp against the receiver’s system clock; they must match within one second.
  • Source identity (device serial, MAC, or ID) appears in every log line; confirm you can query by device without ambiguity.
  • The receiver survives a reboot without losing logs (write to disk, not memory).
  • Log lines for at least one common event (interface state change, configuration reload, DHCP assignment) are queryable by timestamp and device.
  • The operator can answer “show me all config changes on this device in the last week” without SSH-ing to the device.
  • Transport choice (UDP, TCP, or both) and loss tolerance are documented so the next operator knows why this design was chosen.

The pattern compounds when logs join the same system

Network logs alone are useful. Network logs in the same search system as application logs are transformative. When an API server log says “upstream timeout” at 14:32:10 and a switch log says “peer link down” at 14:32:05, correlation happens in a query, not in your head. The operator no longer guesses whether the problem was network or application; the logs say.

Start minimal. One syslog receiver, one search tool, one retention horizon. The architecture scales when you need it to. What matters is that logs leave the device and gain enough structure to join the rest of your observability.

/contact if you’d like to discuss how this applies to your network.