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
- id: C1 claim: Only one call to Dial is necessary. source: S1 evidence: "Only one call to Dial is necessary."
- id: C2 claim: The syslog package is frozen and is not accepting new features. source: S1 evidence: "The syslog package is frozen and is not accepting new features."
- id: C3 claim: An empty tag is replaced by os.Args[0]. source: S2 evidence: "If tag is empty, the [os.Args][0] is used."
Sources
- [S1] log/syslog. The Go Authors. https://pkg.go.dev/log/syslog . License: BSD-3-Clause. Accessed 2026-11-26.
- [S2] log/syslog source. The Go Authors. https://go.dev/src/log/syslog/syslog.go . License: BSD-3-Clause. Accessed 2026-11-26.
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
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.},
}
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.
- go-syslog.schema.json (schema; CC-BY-4.0)
- go-syslog.table.json (table; CC-BY-4.0)
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.