Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yiisoft/yii2-psr-log-source
PSR compatible logger that routes all messages to a Yii2 Logger
https://github.com/yiisoft/yii2-psr-log-source
log logging psr yii2
Last synced: 7 days ago
JSON representation
PSR compatible logger that routes all messages to a Yii2 Logger
- Host: GitHub
- URL: https://github.com/yiisoft/yii2-psr-log-source
- Owner: yiisoft
- Created: 2022-04-15T20:01:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-20T07:59:30.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T23:10:35.136Z (10 months ago)
- Topics: log, logging, psr, yii2
- Language: PHP
- Homepage: https://www.yiiframework.com/
- Size: 10.7 KB
- Stars: 7
- Watchers: 12
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Yii2 Psr Log Source
This simple library implements a PSR compatible logger that routes all messages to a Yii Logger.
Use this if you have a library that needs such a logger and you want to forward the messages to your existing Logger.## Logger adapter
The `Logger` adapter class takes a Yii `Logger` object and implements the `LoggerInterface`.
## DynamicLogger
Since Yii2 uses mutability a lot, the `Logger` adapter might hold a reference to an old Yii `Logger`. To work properly
with the Service Locator pattern we must use it on every call. `DynamicLogger` does this while internally using the `Logger`
and recreating it when needed.