kagatan / monolog-telegram Goto Github PK
View Code? Open in Web Editor NEWLaravel. Monolog Telegram Notification Handler
Laravel. Monolog Telegram Notification Handler
Currently, running something like Log::info('this is a test', ['key' => 'value']);
leads to output like this in Telegram:
2022-06-28 01:34:15
🗨INFO: this is a test
[{"key":"value"}]
So far, so good, right? Now, the issue comes in the $context
portion of things, which I would like to be able to format as code, as the monospaced font in Telegram makes context-lines like this much easier to read. In Telegram, which follows Markdown formatting principles, it's as easy as appending backticks before and after the text you want to display as code, or (in case you have multiple lines), triple backticks before the lines and after the lines.
The output I would want to see looks more like this:
2022-06-28 01:34:15
🗨INFO: this is a test
[{"key":"value"}]
Most Monolog loggers allow you to fiter by minimum level, something I find sorely missing in this particular package (which is otherwise very good!). For example, in a typical laravel configuration, I can do something like this:
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'info',
],
The resulting logs would only show logs with severity "info" or greater, as understood by rfc5424 (DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY), meaning anything of severity "debug" would not end up in the log file.
If you want, I can do a pull request with the relevant functionality, but I wanted to give you the chance to take care of it first.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.