calguy1000/logger 问题修复 & 功能扩展

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

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

calguy1000/logger

Composer 安装命令:

composer require calguy1000/logger

包简介

A powerful application logging, and log querying tool.

README 文档

README

A simple logging utility with rotation, concurrency, repeat counting and search support.

This library provides the ability for your application to log debug messages, info messages, warnings and errors to a text file. The library supports rotation, counting sequentially repeated messages, writing to the same file from multiple processes, and querying the files. It is suitable for applications that need various amounts of debugging, logging or auditing capabilities.

Features

  • Provides a simple, extensible mechanism for allowing an application to perform logging.
  • Provides a logging interface
  • FileLogger class Can count identical sequental messages
  • Can track separate (or combined) keys. Known as a "section" and an "item"
  • AutoRotateFileLogger supports log rotation based on file size (kilobytes) or age (hours) and maximum number of files.
  • Uses exclusive locking to lock filed for writing
  • Supports simple querying of saved log files

Simple logging to a file

require '../vendor/autoload.php'
use calguy1000\logger\FileLogger as FileLogger;
$logger = new FileLogger('logfile.txt');
$logger->debug('A debug message');
$logger->info('An information message');
$logger->warn('A warning message');
$logger->error('A fatal error');

Using the auto-rotate logger

require '../vendor/autoload.php'
use calguy1000\logger\AutoRotateFileLogger as AutoRotateFileLogger;
$logger = new AutoRotateFileLogger('logfile.txt',24,2000,30);
$logger->debug('A debug message');
$logger->info('An information message');
$logger->warn('A warning message');
$logger->error('A fatal error');

Querying the logs

require '../vendor/autoload.php'
use calguy1000\logger\Logger as Logger;
$parms = [ 'filename'=>'logfile.txt','limit'=>50,'msg'=>'*fatal*` ];
$query = new Logger\query($parms);
$rs = $query->execute();
foreach( $rs as $key => $item ) {
   print_r($item);
}

Limitations

  • Each log string can be a maximum of 512 bytes
  • Log files can be a maximum of 50mb in size
  • Log files can be a maximum of 60 days old.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-2.1
  • 更新时间: 2015-08-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固