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.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | phuslu/log |
| Owner | phuslu |
| Primary language | Go |
| License | MIT — OSI-approved |
| Stars | 869 |
| Forks | 61 |
| Open issues | 13 |
| Latest release | Unknown |
| Last updated | 2026-06-23 |
| Source | https://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).
Get the log source
Clone the repository and explore it locally.
git clone https://github.com/phuslu/log.gitcd log# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
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.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Good |
| Assessment confidence | Medium |
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.
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.coRelated on DEV.co
Explore the category and the services that help you build with it.
log FAQ
Is phuslog production-ready?
How does performance compare to zap or logrus?
Does phuslog support log level filtering?
Can I use phuslog with OpenTelemetry or distributed tracing?
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.