submtd/laravel-custom-log 问题修复 & 功能扩展

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

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

submtd/laravel-custom-log

Composer 安装命令:

composer require submtd/laravel-custom-log

包简介

Define custom log drivers from within a class

README 文档

README

Create custom logs from within classes in Laravel.

Installation

composer require submtd/laravel-custom-log

Usage

Add the HasCustomLog trait to your class, and add a public static method called logChannel().

<?php

use Submtd\LaravelCustomLog\HasCustomLog;

class Person
{
    use HasCustomLog;
    
    /**
     * logChannel method
     * Method used to define a custom log channel for this class.
     * @return array -- return a Laravel log channel array
     **/
    public static function logChannel()
    {
        return [
            'driver' => 'single',
            'path' => storage_path('logs/person.log'),
            'level' => 'warning',
        ];
    }
}

Logging

In order to log a message to your custom log channel, call static::debug('This is a log message').

Available log methods are as follows:

static::debug($message);
static::info($message);
static::notice($message);
static::warning($message);
static::error($message);
static::critical($message);
static::alert($message);
static::emergency($message);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固