k1low/yalog

Yalog: CakePHP 的另一个日志记录器

资助包维护!
k1LoW

安装次数: 6,337

依赖项: 1

建议者: 0

安全: 0

星标: 19

关注者: 4

分支: 4

开放问题: 0

类型:cakephp-plugin

2.5.5 2014-10-23 01:46 UTC

This package is auto-updated.

Last update: 2024-09-06 09:48:05 UTC


README

Build Status

RotateFileLog

使用方法

首先,将 `Yalog' 目录放在您的 CakePHP 应用程序的 app/Plugin 中。

其次,在 bootstrap.php 中添加以下代码。

<?php

    CakePlugin::load('Yalog');
    // or
    // CakePlugin::loadAll();

    App::uses('CakeLog', 'Log');
    CakeLog::config('debug', array(
        'engine' => 'Yalog.RotateFileLog',
        'types' => array('notice', 'info', 'debug'),
        'file' => 'debug',
    ));
    CakeLog::config('error', array(
        'engine' => 'Yalog.RotateFileLog',
        'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
        'file' => 'error',
    ));

配置

轮转

<?php
    Configure::write('Yalog.RotateFileLog.weekly', true);
    Configure::write('Yalog.RotateFileLog.rotate', 4);

Log4php (示例)

使用方法

首先,将 `Yalog' 目录放在您的 CakePHP 应用程序的 app/Plugin 中。

其次,将 log4php 源目录放在您的 CakePHP 应用程序的 app/Plugin/Yalog/Vendor/log4php 中。

    https://logging.apache.ac.cn/log4php/download.html

第三,在 bootstrap.php 中添加以下代码。

<?php
    CakeLog::config('debug', array(
        'engine' => 'Yalog.Log4php',
        'types' => array('notice', 'info', 'debug'),
        'file' => 'debug',
    ));
    CakeLog::config('error', array(
        'engine' => 'Yalog.Log4php',
        'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
        'file' => 'error',
    ));

配置

修改以下内容:

  • app/Plugin/Yalog/Lib/Log/Engine/log4php.properties
  • app/Plugin/Yalog/Lib/Log/Engine/log4php.php 中的 Log4php::write()

许可证

MIT 许可证