Download the PHP package phel-lang/phel-log without Composer
On this page you can find all versions of the php package phel-lang/phel-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phel-lang/phel-log
More information about phel-lang/phel-log
Files in phel-lang/phel-log
Package phel-log
Short Description Data-driven logging library for Phel Lang. Inspired by Timbre + Monolog. Levels, namespace filtering, pluggable appenders, PSR-3 adapter, Monolog handler bridge.
License MIT
Homepage https://phel-lang.org/
Informations about the package phel-log
phel-log
Data-driven logging library for Phel Lang. Inspired by Timbre (Clojure) and Monolog (PHP).
- Pure-data config: one map, swap it at runtime.
- Levels with namespace + per-appender filters.
- Pluggable appenders: console, file, in-memory, Monolog handler bridge.
- Pluggable formatters: line, JSON, custom fn.
- Processors (middleware) for masking / enriching events.
- PSR-3
LoggerInterfaceadapter for Symfony / Laravel / Slim interop.
Install
Requires PHP 8.4+ and phel-lang/phel-lang 0.37+.
Optional: monolog/monolog 3.x for the Monolog handler bridge.
Configure
Levels
:trace -> :debug -> :info -> :warn -> :error -> :fatal -> :report
Each level has a macro: log/trace, log/debug, ..., log/report. The call-site
namespace is captured at macro-expand time, no extra plumbing.
Appenders
| Appender | Purpose |
|---|---|
console-appender |
stdout for info-, stderr for warn+ |
file-appender |
append-only, lock-on-write |
memory-appender |
capture events into an atom (tests / REPL) |
monolog-appender |
bridge any Monolog\Handler\HandlerInterface |
All appenders share the same shape:
Write your own by returning a map of the same shape; everything in
log/write-event! is data-driven.
Formatters
:line- human one-liner (timestamp, level, ns, message, data).:json- one JSON object per line; pipe straight into Loki / ELK / CloudWatch.(fn [event] string)- anything you want; the event is a plain map.
Monolog handler bridge
Re-use every existing Monolog handler (Slack, Sentry, Syslog, RotatingFile, ...):
PSR-3 adapter
Drop the Phel logger into a PSR-3-aware PHP framework:
Docs
Full index at docs/README.md — start with
Config /
Appenders. Integrations:
PSR-3.
Contributing
Run tests:
Conventional commits, PR template in .github/PULL_REQUEST_TEMPLATE.md.