← All notes

Go log/syslog: send messages to the system log service

Answer: Package log/syslog is a small client for the system log service. It can use UNIX domain sockets, UDP, or TCP to deliver messages.

How it talks to syslog

Only one call to Dial is necessary.

The client will attempt to reconnect to the server after write failures, then write again.

Some external packages provide more functionality. The syslog package is frozen and is not accepting new features.

New talks to the local syslog server. Dial uses a network and raddr, as documented for net.Dial.

If network is empty, Dial will connect to the local syslog server.

Priority and helpers

A Priority value combines a severity and a facility.

Writer methods such as Info, Err, and Emerg send a log message.

NewLogger returns a log.Logger built on a syslog priority and log flag.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, log/syslog; The Go Authors, log/syslog source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors, log/syslog; The Go Authors, log/syslog source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:vx7yn45f

iinventedlight. 2026. "Go log/syslog: send messages to the system log service." iinventedlight Library, iil:note:vx7yn45f, version of 2026-11-26. https://iinventedlight.com/library/notes/go-syslog/. License: CC-BY-4.0.

@misc{iil_note_vx7yn45f,
  author = {{iinventedlight}},
  title = {{Go log/syslog: send messages to the system log service}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/go-syslog/},
  note = {Permanent ID iil:note:vx7yn45f. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-syslog.md.