DEV.co
Open-Source Observability · phuslu

log

phuslog is a Go structured logging library optimized for high-performance JSON output with zero external dependencies. It provides multiple writer backends (console, file, async, syslog, journal, eventlog) and claims to be significantly faster than competing JSON loggers.

Source: GitHub — github.com/phuslu/log
869
GitHub stars
61
Forks
Go
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryphuslu/log
Ownerphuslu
Primary languageGo
LicenseMIT — OSI-approved
Stars869
Forks61
Open issues13
Latest releaseUnknown
Last updated2026-06-23
Sourcehttps://github.com/phuslu/log

What log is

Dependency-free Go logger generating JSON output via a fluent API with pluggable writers (IOWriter, ConsoleWriter, FileWriter, AsyncWriter, MultiLevelWriter, SyslogWriter, JournalWriter, EventlogWriter). Supports stdlib log and slog interoperability, file rotation via symlink-based approach, and utility functions (Goid, NewXID, fast pseudorandom, IsTerminal).

Quickstart

Get the log source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/phuslu/log.gitcd log# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

High-throughput JSON logging in backend services

Ideal for microservices and APIs where structured logging with minimal latency overhead is critical. The async writer combined with file rotation supports sustained logging at scale.

Structured logging with rotation and archival

FileWriter with MaxSize, MaxBackups, and custom Cleaner functions supports rotating logs by size, with symlink tracking of current file and optional hostname/PID in filename.

Multi-environment logging (dev, staging, prod)

ConsoleWriter for human-readable colorized output in development, switchable to JSON or syslog/journal/eventlog backends for production without code changes.

Implementation considerations

  • No external dependencies simplifies vendoring and reduces supply-chain risk; verify this remains true across Go version updates.
  • Fluent API design (log.Info().Str().Int().Msg()) is ergonomic but requires understanding level filtering and when Caller/TimeFormat settings affect performance.
  • AsyncWriter performance gains require pairing with appropriate FileWriter settings and understanding buffering behavior under load.
  • ConsoleWriter Formatter callback enables custom formats (glog, etc.) but adds complexity; test output performance in your specific environment.
  • FileWriter symlink-based rotation is non-standard on Windows; plan deployment strategy and test file access patterns in target OS.

When to avoid it — and what to weigh

  • Console output on hot path in high-concurrency apps — README explicitly warns that ConsoleWriter should not be used on critical paths in high-concurrency, low-latency applications due to formatting overhead.
  • Windows environments requiring file rotation — FileWriter uses symlinks for current log file tracking, which may require administrator privileges on Windows and may not be suitable for all deployment scenarios.
  • Projects requiring battle-tested logging with extensive ecosystem — phuslog is smaller (869 stars, 61 forks) compared to established options like logrus or zap. Community adoption is moderate; production use should verify stability in target environment.
  • Time-based log rotation (daily/monthly) as primary requirement — FileWriter does not rotate based on broad TimeFormat values (daily, monthly) until file reaches MaxSize. Workaround would require custom logic outside the library.

License & commercial use

MIT License. Permissive OSI-compliant license permitting commercial use, modification, and distribution with attribution. No copyleft obligations.

MIT is a permissive license clearly allowing commercial use. No proprietary restrictions. Recommended to review the full LICENSE file in the repository and consult your legal team if using as part of a vendor offering, but no licensing barriers to closed-source commercial applications.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceMedium
Security considerations

No security issues disclosed in provided data. Zero external dependencies reduce attack surface. Caller field includes file:line which may leak path information in logs exposed to untrusted parties; configure Caller=-1 or 0 as appropriate. FileWriter and SyslogWriter write to filesystem/system services; ensure appropriate file permissions and syslog access controls. Async batching may delay log flushing; verify buffering strategy acceptable for compliance logging. No mention of secure credential redaction; implement field filtering or custom formatter if logging sensitive data.

Alternatives to consider

zap (Uber)

More battle-tested (20k+ stars), larger ecosystem, explicit performance benchmarking, widely adopted in cloud-native projects. Trade-off: heavier dependency footprint.

slog (stdlib, Go 1.21+)

Native to Go stdlib, no external dependency, growing ecosystem support. Trade-off: phuslog offers more writers (syslog, journal, eventlog) and claims faster JSON serialization.

logrus

Mature, large community, plugins ecosystem, easy stdlib integration. Trade-off: phuslog claims better performance; logrus is more established for general-purpose logging.

Software development agency

Build on log with DEV.co software developers

phuslog offers zero-dependency structured logging with multiple backends and claimed high performance. Evaluate against zap or slog for your Go services. Devco can help architect and implement logging infrastructure for your cloud-native stack.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

log FAQ

Is phuslog production-ready?
Likely yes for standard use cases (JSON file logging, console output, syslog). No formal stability guarantee in provided data; verify testing and stability in your target Go version and OS before critical deployment. 13 open issues suggest active development.
How does performance compare to zap or logrus?
README claims 'significantly faster than all other json loggers' but provided excerpt lacks detailed benchmarks, latency numbers, or throughput comparisons. Independent benchmarking or consulting referenced benchmark links is required.
Does phuslog support log level filtering?
Yes, Logger.Level field defines the threshold (DebugLevel, InfoLevel, etc.). Logs below the threshold are not written.
Can I use phuslog with OpenTelemetry or distributed tracing?
NewXID() generates tracing IDs you can log, but integration with OpenTelemetry or Jaeger requires custom middleware or wrapper code. Not built-in.

Work with a software development agency

DEV.co helps companies turn open-source tools like log into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source observability stack.

Ready to optimize your logging pipeline?

phuslog offers zero-dependency structured logging with multiple backends and claimed high performance. Evaluate against zap or slog for your Go services. Devco can help architect and implement logging infrastructure for your cloud-native stack.