GithubHelp home page GithubHelp logo

yii2-log-reader's Introduction

Yii2 Log Reader

Yii2 log reader

this project is extend from zhuravljov/yii2-logreader, and Add more operation like delete download tail and so on.

from 2.0. history can load file that Yii2 FileTarget rotated. See History Usage

Preview

Index

preview1

History

preview2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist kriss/yii2-log-reader "2.*"

or add

"kriss/yii2-log-reader": "2.*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply modify your application configuration as follows:

return [
    'bootstrap' => ['log-reader'],
    'modules' => [
        'log-reader' => [
            'class' => 'kriss\logReader\Module',
            //'as login_filter' => UserLoginFilter::class, // to use login filter
            'aliases' => [
                'Frontend' => '@frontend/runtime/logs/app.log',
                'Backend' => '@backend/runtime/logs/app.log',
                'Console' => '@console/runtime/logs/app.log',
            ],
            //'defaultTailLine' => 200,
        ],
    ],
];

You can then access Log Reader using the following URL:

http://localhost/path/to/index.php?r=log-reader

or if you have enabled pretty URLs, you may use the following URL:

http://localhost/path/to/log-reader

History Usage

For every day log view, you can config yii log like this:

[
    'class' => 'yii\log\FileTarget',
    'categories' => ['test'],
    'logVars' => [],
    'logFile' => '@runtime/logs/test/test.log.' . date('Ymd'), // important
    'maxLogFiles' => 31,
    'dirMode' => 0777,
    'fileMode' => 0777,
]

And config log-reader module aliases like:

'test' => '@runtime/logs/test/test.log'

Then log with be save filename like test.log.20190924. This is log-reader history load filename.

So you can view every day log in history action.

yii2-log-reader's People

Contributors

krissss avatar piotrchludzinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yii2-log-reader's Issues

Error trying to install this extension with composer

I get the following error when I try to install your yii2-log-reader extension

C:\wamp64\www\pmtts>composer require --prefer-dist kriss/yii2-log-reader "2.4" --ignore-platform-reqs
./composer.json has been updated
Running composer update kriss/yii2-log-reader
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires kriss/yii2-log-reader, it could not be found in any version, there may be a typo in the package name.

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Any help in getting this extension installed would be very much appreciated.

Thank you

Lloyd

Doesn't work on php 7.2

yii\base\ErrorException: Cannot use yii\base\Object as Object because 'Object' is a special class name

:(

How to use this feature as login_filter ?

What exactly needs to be done in this class ? and even if i create and it say object cannot be passed .

'as login_filter' => UserLoginFilter::class, // to use login filter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.