承接 lswl/laravel-log 相关项目开发

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

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

lswl/laravel-log

Composer 安装命令:

composer require lswl/laravel-log

包简介

Laravel log.

README 文档

README

环境变量值参考:env

安装配置

使用以下命令安装:

$ composer require lswl/laravel-log

快速使用

  • 配置环境变量
  • LSWL_LOG_DEBUG=falsedebug 级别日志不写入(默认为 fasle)
  • 方法介绍:
    • dir(string $dir) 设置日志保存路径,相对于 storage/logs
    • name(string $dir) 设置日志名称(默认为 laravel.log)
    • withDateToDir(bool $isBefore = true, string $format = 'Ymd') 给路径添加日期
    • withDateToName(bool $isBefore = true, string $format = 'Ymd') 给名称添加日期
    • withRequestInfo(bool $with = true) 日志添加请求消息
    • withMessageLineBreak(bool $with = true) 日志添加消息换行
    • throwable(Throwable $e, array $context = []) 记录异常日志
  • 书写业务代码

业务代码:

use Lswl\Log\Log;

// 添加各个级别日志
// emergency、alert、 critical、 error、 warning、 notice、 info 和 debug
Log::info('This is info log');

// 添加指定路径
// app/storage/logs/d/laravel.log
Log::dir('d')
->info('This is info log');
// app/storage/logs/20200101/d/laravel.log
Log::dir('d')
->withDateToDir()
->info('This is info log');

// 添加指定名称路径
// app/storage/logs/d/i.log
Log::dir('d')
->name('i')
->info('This is info log');
// app/storage/logs/d/20200101-i.log
Log::dir('d')
->name('i')
->withDateToName()
->info('This is info log');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固