Home

Awesome

#Laravel 4 LogViewer

Easily view and delete Laravel 4's logs.

Inspiration from Fire Log for CodeIgniter by David Morrow and Larvel Log Viewer for Laravel 3 by Eric Barnes

Created and maintained by Micheal Mand. Copyright © 2013. Licensed under the MIT license.

Build Status Total Downloads


#A note about Laravel 4.1

As of right now (2013-11-29), fresh Laravel 4.1 applications log things differently than they used to. While this doesn't technically break LogViewer, LogViewer also doesn't know how to handle these changes. Here's a quick fix:

In your app/start/global.php, line 34 change:

Log::useFiles(storage_path().'/logs/laravel.log');

to:

$logFile = 'log-'.php_sapi_name().'.txt';

Log::useDailyFiles(storage_path().'/logs/'.$logFile);

This only applies to new installations of Laravel 4.1. If you've upgraded an existing 4.0 application (and did not make changes to the way logs are created and stored), everything should still work.


##Demo

View the demo here

##Installation

Add kmd/logviewer as a requirement to composer.json:

{
    ...
    "require": {
        ...
        "kmd/logviewer": "1.2.*"
        ...
    },
}

Update composer:

$ php composer.phar update

Add the provider to your app/config/app.php:

'providers' => array(

    ...
    'Kmd\Logviewer\LogviewerServiceProvider',

),

Publish package assets:

$ php artisan asset:publish kmd/logviewer

(Optional) You can configure your composer.json to do this after each $ composer update:

"scripts":{
    "post-update-cmd":[
        "php artisan asset:publish kmd/logviewer",
        "php artisan optimize",
    ]
},

(Optional) Publish package config:

$ php artisan config:publish kmd/logviewer

Please note: if you have made changes in your app/config/packages/kmd/logviewer/config.php, DO NOT publish the package config again. It will overwrite yours without any warning.

##Usage and Configuration

###Usage

By default, LogViewer will register itself a couple of routes:

LogViewer also registers a couple filters:

###Configuration

Advanced Usage

Don't like the way LogViewer looks? Need to integrate it better with your application's theme? You can do so by creating your own view and changing the configuration option. Here are the variables that are sent to the view: