Download the PHP package flytachi/winter-logger without Composer
On this page you can find all versions of the php package flytachi/winter-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package winter-logger
Winter Logger
flytachi/winter-logger — multi-runtime PSR-3 logger for the Winter framework. Wraps Monolog with coroutine-safe context isolation, Spring Boot-style output, and a Java-style static factory.
The library is infrastructure-agnostic: it knows nothing about env vars, Docker, SAPI, or Swoole detection — that responsibility belongs to the framework that boots it.
Requirements
- PHP >= 8.3
psr/log^3.0monolog/monolog^3.5 (suggested — without it every logger silently becomesNullLogger)ext-swoole(optional — required only forCoroutineContext)
Installation
Monolog-free (every logger will be a no-op NullLogger):
Quick Start
1. Build a LoggerManager
The manager accepts a ready-made config — the framework resolves env vars and infrastructure details before calling this:
2. Register with LoggerFactory
3. Log from anywhere
Output (line format)
Request-scoped context
Set fields once at the start of a request/job and they appear in every log line
automatically via ContextInjectingProcessor:
For Swoole use CoroutineContext — it isolates context per coroutine so
concurrent requests never bleed into each other.
Channel config reference
| Key | Type | Description |
|---|---|---|
level |
Monolog\Level |
Minimum level to handle |
format |
'line' | 'json' |
Log format |
output |
'stdout' | 'stderr' | 'syslog' | 'file' | 'null' |
Where to write |
file_path |
string\|null |
Required when output=file |
file_max |
int |
Max rotated files to keep (default 30) |
syslog_ident |
string |
Syslog process identifier (default 'winter') |
Processors
ContextInjectingProcessor is added to every channel automatically — no config needed.
SensitiveMaskingProcessor is optional. Add it after building the manager:
Default masked keys: password, token, secret, api_key, authorization,
cookie, credit_card, cvv, ssn, pin, and more.
Documentation
| File | Topic |
|---|---|
| 00-overview.md | Architecture — how the pieces fit together |
| 01-installation.md | Installation, optional Monolog |
| 02-channels.md | LoggerManager, channel config, output types |
| 03-logger-factory.md | LoggerFactory, getLogger, withContext |
| 04-context.md | ProcessContext, CoroutineContext, lifecycle |
| 05-handlers-formatters.md | SafeStreamHandler, formatters, broken pipe |
| 06-processors.md | ContextInjectingProcessor, SensitiveMaskingProcessor |
License
MIT License. See LICENSE.