承接 czim/laravel-context-log-library 相关项目开发

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

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

czim/laravel-context-log-library

Composer 安装命令:

composer require czim/laravel-context-log-library

包简介

Library for context logging for Laravel

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status

Context Logging library for Laravel

Helper library for standard setup of czim/laravel-json-context-logging.

This helps you to quickly create context channels for logging. It is not a requirement for using JSON context logging.

Version Compatibility

Laravel Package
6.0 - 8.0 1.0
9.0 2.0
10.0 and up 3.0

Installation

No installation required; however, classes must be bound manually in your service provider.

<?php

use Czim\LaravelContextLogging\Config\StandardJsonContextConfigSource;
use Czim\LaravelContextLogging\Contracts\ContextLoggerFactoryInterface;
use Czim\LaravelContextLogging\Contracts\DebugEventLogPrepperInterface;
use Czim\LaravelContextLogging\Factories\ContextLoggerFactory;

class AppServiceProvider extends \Illuminate\Support\ServiceProvider
{
    // ...

    public function register(): void
    {
        $this->app->singleton(
            DebugEventLogPrepperInterface::class,
            \Your\JsonContextEventLogPrepper::class
        );

        $this->app->singleton(
            ContextLoggerFactoryInterface::class,
            function (): void {
                $factory = new ContextLoggerFactory();
                $factory->setConfigs($this->makeLogContextConfigArray());
                return $factory;
            }
        );
    }

    protected function makeLogContextConfigArray(): array
    {
        return $this->app->make(StandardJsonContextConfigSource::class)
            ->enableContextLogging()
            ->makeConfigArray();
    }
}

You will also have to set up your own event, which may extend Czim\LaravelContextLogging\Events\AbstractDebugEvent. The listener for that event should use the ContextLoggerFactoryInterface to make a logger, and the DebugEventLogPrepperInterface to render the event into loggable data to be logged by it.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-12-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固