Download the PHP package bnomei/kirby3-monolog without Composer
On this page you can find all versions of the php package bnomei/kirby3-monolog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bnomei/kirby3-monolog
More information about bnomei/kirby3-monolog
Files in bnomei/kirby3-monolog
Package kirby3-monolog
Short Description Use Monolog to log data to files/databases/notifications/...
License MIT
Informations about the package kirby3-monolog
Kirby Monolog
Use Monolog to log data to files/databases/notifications/...
Installation
- unzip master.zip as folder
site/plugins/kirby3-monolog
or git submodule add https://github.com/bnomei/kirby3-monolog.git site/plugins/kirby3-monolog
orcomposer require bnomei/kirby3-monolog
Quickstart
site/templates/home.php
site/logs/2024-10-27.log
Page-Method
This plugin also registers a Page-Method which will use the UUID of the page as a channel
. You can use it like this:
site/logs/2024-10-27.log
Setup
Use the default channel provided by this plugin or define your own Channels. Monolog comes bundled with a lot of handlers, formatters and processors.
- write to file or syslogs
- send mails
- post to Slack/Discord
- insert into local or remote databases
- format as JSON
- append file/class/method Introspection
- append a UUID
- append URI, post method and IP
- ... create your own
Usecase
Named Channel => Logger
Add records to the Logger
Message
Message and Context
Default Channel
The default channel provided by this plugin writes file to the site/logs
folder. It will be using the filename format date('Y-m-d') . '.log'
and normalizes the data to make logging Kirby Objects easier.
[!NOTE] Without that normalization you would have to call
->value()
or cast asstring
on every Kirby Field before adding its value as context data.
Custom Channel
site/config/config.php
Custom Channel Extends
site/config/config.php
Dependencies
Disclaimer
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.
License
It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.