承接 comphp/logging-monolog 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

comphp/logging-monolog

Composer 安装命令:

composer require comphp/logging-monolog

包简介

Logging Driver for CommonPHP which wraps the Monolog library for Runtime compliance

README 文档

README

Logging driver for CommonPHP that wraps Monolog for configurable PSR-3 logging.

Requirements

  • PHP ^8.5
  • comphp/logging:^0.3
  • monolog/monolog

Installation

Once this package is available through your Composer repositories, install it with:

composer require comphp/logging-monolog

Usage

<?php

use CommonPHP\Drivers\Logging\Monolog\MonologDriverOptions;
use CommonPHP\Drivers\Logging\Monolog\MonologHandlerFactory;
use CommonPHP\Drivers\Logging\Monolog\MonologLogDriver;
use CommonPHP\Logging\LogManager;

$handlers = new MonologHandlerFactory();

$logger = new LogManager(new MonologLogDriver(options: new MonologDriverOptions(
    channel: 'app',
    handlers: [
        $handlers->file(__DIR__ . '/var/app.log'),
    ],
)));

$logger->info('User {user} logged in.', ['user' => 'ada']);

Driver Notes

This driver is intended to let CommonPHP Logging use Monolog handlers, processors, formatters, and channels without making the core logging package depend directly on Monolog.

Applications may use this driver when they need production-ready logging targets, rotation, formatting, or integrations that Monolog already supports.

MonologLoggerFactory, MonologHandlerFactory, MonologFormatterFactory, and MonologProcessorFactory provide small helpers for common setup while still allowing applications to pass native Monolog objects directly.

Error Handling

Logger setup, handler, formatting, write, and configuration failures should throw CommonPHP logging driver exceptions when logging cannot be completed or configured safely.

Documentation

License

MIT. See LICENSE.md.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固