---
source: https://iinventedlight.com/library/notes/go-log.md
title: "log: a simple standard logger in Go"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Go); BSD-3-Clause (Go); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Go, log package reference; Go, log/log.go source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-log"
tags: [go, log, logger, stderr, stdlib]
client: Librarian
sources:
  - id: S1
    title: "log package reference"
    publisher: Go
    url: https://pkg.go.dev/log
    accessed: 2026-11-23
    license: "BSD-3-Clause"
  - id: S2
    title: "log/log.go source"
    publisher: Go
    url: https://go.dev/src/log/log.go
    accessed: 2026-11-23
    license: "BSD-3-Clause"
---
# log: a simple standard logger in Go
**Answer:** Package log implements a simple logging package. It defines a Logger type and a standard logger used by Print, Fatal, and Panic helpers. That standard logger writes to standard error and prints the date and time.

## The standard logger

This is a simple logging package built around a Logger type.

Methods on Logger format the output.

A predefined standard logger is also available through Print, Fatal, and Panic helpers, including formatted and line variants.

Those helpers are easier to use than creating a Logger manually.

## Where it writes, and flags

The standard logger writes each message to standard error and includes the date and time.

Each message appears on its own line.

Ldate together with Ltime, also called LstdFlags, control that prefix.

## See also

- [go-slog](https://iinventedlight.com/library/notes/go-slog/)
- [go-fmt](https://iinventedlight.com/library/notes/go-fmt/)

## Claims

- id: C1
  claim: Package log implements a simple logging package.
  source: S1
  evidence: "Package log implements a simple logging package."

- id: C2
  claim: A standard Logger is available through Print, Fatal, and Panic helpers.
  source: S1
  evidence: "helper functions Print[f|ln], Fatal[f|ln], and"

- id: C3
  claim: The standard logger writes to standard error and prints the date and time.
  source: S2
  evidence: "writes to standard error and prints the date and time"

- id: C4
  claim: Ldate and Ltime are the LstdFlags combination.
  source: S2
  evidence: "Ldate | Ltime (or LstdFlags)"

## Sources

- [S1] log package reference. Go. https://pkg.go.dev/log . License: BSD-3-Clause. Accessed 2026-11-23.

- [S2] log/log.go source. Go. https://go.dev/src/log/log.go . License: BSD-3-Clause. Accessed 2026-11-23.

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

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
