Download the PHP package limingxinleo/x-phalcon-logger without Composer
On this page you can find all versions of the php package limingxinleo/x-phalcon-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package x-phalcon-logger
X-Phalcon-Logger
安装
composer require limingxinleo/x-phalcon-logger
使用
<?php
use Xin\Phalcon\Logger\Factory;
use Phalcon\Config;
use Phalcon\Logger\Formatter\Line;
use Xin\Phalcon\Logger\Sys;
// 初始化工厂
$config = new Config([
'application' => [
'logDir' => __DIR__ . '/../logs/',
],
]);
$factory = new Factory($config);
$context = [
'dir' => 'test' // 如果不设置子目录,则根据日期分目录
];
// 获取单例日志实例
$logger = $factory->getLogger('info', Sys::LOG_ADAPTER_FILE, $context);
// 设置格式化
$formatter = new Line("[%date%][%type%] %message%", "Y-m-d H:i:s");
$logger->setFormatter($formatter);
// 写入日志
$logger->info('日志数据');
All versions of x-phalcon-logger with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6
ext-phalcon Version ^3.0
limingxinleo/x-support-file Version ^1.0
psr/log Version ^1.0
ext-phalcon Version ^3.0
limingxinleo/x-support-file Version ^1.0
psr/log Version ^1.0
The package limingxinleo/x-phalcon-logger contains the following files
Loading the files please wait ....