presprog/kirby-monolog 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

presprog/kirby-monolog

最新稳定版本:0.1.1

Composer 安装命令:

composer require presprog/kirby-monolog

包简介

Use the Monolog logger library with Kirby CMS

README 文档

README

This plugin adds the Monolog logging library to Kirby.

⚡ Ready for Kirby 4!

🤟Usage

Use the monolog() helper function:

// Write to the default log file
monolog()->log('something happend 😱');

// Log to another channel (only changes the filename for now)
// Will log to "your-log-dir/other-channel-$date.log"
monolog('other-channel')->log('something happend 😱');

// Change the log level (any of \Psr\Log\LogLevel)
monolog()->log('something CRITICAL happend 😱', 'critical');

// …

If you throw and handle exceptions in your own code, you may log them with site()->logException():

try {
    // ..
} catch(\Exception $exception) {
    site()->logException($exception)
}

This will log the exception message with critical level alongside the stack trace.

The plugin also automatically listens to Kirby system.exception hook and logs the exception message as well as the stacktrace to the default log file.

💻 How to install

via Composer (recommended)

$ composer require presprog/kirby-monolog:^0.1

via ZIP archive

Download the ZIP archive, extract it into your plugins folder (defaults to site/plugins) and rename the subfolder to monolog.

✅ To do

  • Define more channels via the config file

Alternatives

There are plenty of alternatives:

Made with ♥️ and ☕ by Present Progressive

统计信息

  • 总下载量: 500
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固