All Projects → yiisoft → log-target-file

yiisoft / log-target-file

Licence: BSD-3-Clause license
Yii Logging Library - File Target

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to log-target-file

sprout
Golang logging library supporting log retrieval.
Stars: ✭ 85 (+347.37%)
Mutual labels:  log, file
log
PSR-3 compatible logger
Stars: ✭ 32 (+68.42%)
Mutual labels:  log, yii3
files
Useful methods to manage files and directories
Stars: ✭ 27 (+42.11%)
Mutual labels:  file, yii3
gologger
A concurrent, fast queue/service worker based filesystem logging system perfect for servers with concurrent connections
Stars: ✭ 16 (-15.79%)
Mutual labels:  log, file
Android Filelogger
A general-purpose logging library with built-in support to save logs to file efficiently.
Stars: ✭ 70 (+268.42%)
Mutual labels:  log, file
Xlog
Android logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
Stars: ✭ 2,468 (+12889.47%)
Mutual labels:  log, file
aushape
A library and a tool for converting audit logs to XML and JSON
Stars: ✭ 37 (+94.74%)
Mutual labels:  log, file
Naza
🍀 Go basic library. || Go语言基础库
Stars: ✭ 253 (+1231.58%)
Mutual labels:  log, file
Androidutilcode
AndroidUtilCode 🔥 is a powerful & easy to use library for Android. This library encapsulates the functions that commonly used in Android development which have complete demo and unit test. By using it's encapsulated APIs, you can greatly improve the development efficiency. The program mainly consists of two modules which is utilcode, which is commonly used in development, and subutil which is rarely used in development, but the utils can be beneficial to simplify the main module. 🔥
Stars: ✭ 30,239 (+159052.63%)
Mutual labels:  log, file
Go Logger
一个简单而强大的 golang 日志工具包,支持同步和异步输出到 命令行,文件, api 接口,文件支持按文件大小,文件行数,日期切分;A simple and powerful golang logging toolkit that supports synchronous and asynchronous output to the console, file, API interfaces, file support by file size, file line number, date sharding.
Stars: ✭ 152 (+700%)
Mutual labels:  log, file
TLog
Android日志工具
Stars: ✭ 16 (-15.79%)
Mutual labels:  log, file
yii-event
Events for Yii applications
Stars: ✭ 12 (-36.84%)
Mutual labels:  yii3
ngx-fire-uploader
Angular Fire Uploader
Stars: ✭ 18 (-5.26%)
Mutual labels:  file
html
Handy library to generate HTML
Stars: ✭ 42 (+121.05%)
Mutual labels:  yii3
PCPXlog
通过简单配置将日志同时输出到console、file、MongoDB | 可以pip安装
Stars: ✭ 13 (-31.58%)
Mutual labels:  log
kuafu
This is a tool library that includes log, fsm, state machine...
Stars: ✭ 83 (+336.84%)
Mutual labels:  log
logtail
logtail is a log tailing utility, support tailing multiple commands output stream, transferring matching content to file/webhook(like dingtalk)
Stars: ✭ 33 (+73.68%)
Mutual labels:  log
data-response
www.yiiframework.com/
Stars: ✭ 12 (-36.84%)
Mutual labels:  yii3
base
小而美的业务基础框架,也是本项目的核心
Stars: ✭ 47 (+147.37%)
Mutual labels:  log
file-input-accessor
Angular directive that provides file input functionality in Angular forms.
Stars: ✭ 32 (+68.42%)
Mutual labels:  file

Yii Logging Library - File Target


Latest Stable Version Total Downloads Build status Scrutinizer Code Quality Code Coverage Mutation testing badge static analysis type-coverage

This package provides the File target for the yiisoft/log. The target:

  • records log messages in a file
  • allows you to configure log files rotation
  • provides the ability to compress rotated log files

Requirements

  • PHP 8.0 or higher.

Installation

The package could be installed with composer:

composer require yiisoft/log-target-file --prefer-dist

General usage

Creating a rotator:

$rotator = new \Yiisoft\Log\Target\File\FileRotator(
    $maxFileSize,
    $maxFiles,
    $fileMode,
    $compressRotatedFiles
);
  • $maxFileSize (int) - The maximum file size, in kilo-bytes. Defaults to 10240, meaning 10MB.
  • $maxFiles (int) - The number of files used for rotation. Defaults to 5.
  • $fileMode (int|null) - The permission to be set for newly created files. Defaults to null.
  • $compressRotatedFiles (bool) - Whether to compress rotated files with gzip. Defaults to false.

Creating a target:

$fileTarget = new \Yiisoft\Log\Target\File\FileTarget(
    $logFile,
    $rotator,
    $dirMode,
    $fileMode
);
  • $logFile (string) - The log file path. Defaults to /tmp/app.log.
  • $rotator (\Yiisoft\Log\Target\File\FileRotatorInterface|null) - Defaults to null, which means that log files will not be rotated.
  • $dirMode (int) - The permission to be set for newly created directories. Defaults to 0775.
  • $fileMode (int|null) - The permission to be set for newly created log files. Defaults to null.

Creating a logger:

$logger = new \Yiisoft\Log\Logger([$fileTarget]);

For a description of using the logger, see the yiisoft/log package.

For use in the Yii framework, see the configuration files:

See Yii guide to logging for more info.

Testing

Unit testing

The package is tested with PHPUnit. To run tests:

./vendor/bin/phpunit

Mutation testing

The package tests are checked with Infection mutation framework. To run it:

./vendor/bin/infection

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

License

The Yii Logging Library - File Target is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].