PHPackages                             bankdev/logviewer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. bankdev/logviewer

ActiveLibrary

bankdev/logviewer
=================

Laravel 4.2 log file viewer.

2551[1 issues](https://github.com/BankDev/Laravel4.2-LogViewer/issues)PHP

Since Aug 6Pushed 11y ago1 watchersCompare

[ Source](https://github.com/BankDev/Laravel4.2-LogViewer)[ Packagist](https://packagist.org/packages/bankdev/logviewer)[ RSS](/packages/bankdev-logviewer/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Laravel 4.2 LogViewer

Easily view and delete Laravel 4's logs.

Inspiration from [Fire Log](https://github.com/dperrymorrow/Fire-Log) for CodeIgniter by [David Morrow](https://github.com/dperrymorrow) and [Larvel Log Viewer](https://github.com/ericbarnes/Laravel-Log-Viewer) for Laravel 3 by [Eric Barnes](https://github.com/ericbarnes)

Created and maintained by Micheal Mand. Copyright © 2013. Licensed under the [MIT license](LICENSE.md).

[![Build Status](https://camo.githubusercontent.com/c12e91a0b2051c4a4b8aa387e44e03838ef7987702eac2dd53d8cfe2d2da8f0d/68747470733a2f2f7472617669732d63692e6f72672f6d696b656d616e642f6c6f677669657765722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mikemand/logviewer) [![Total Downloads](https://camo.githubusercontent.com/74c175c41614f7a15bcf64c2bce95106c85c28e56e13ee3078f25fc0022d1efa/68747470733a2f2f706f7365722e707567782e6f72672f6b6d642f6c6f677669657765722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/kmd/logviewer)

---

\#A note about Laravel 4.2

Laravel 4.2 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](https://github.com/laravel/laravel/blob/develop/app/start/global.php#L34) change:

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

to:

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

$logFile ::: Can create your own file name. ^___^

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

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

---

\##Screen Shot

[View the screen shot here](https://dl.dropboxusercontent.com/u/52302831/Screen-Shot.png)

\##Installation

Add `bankdev/logviewer` as a requirement to `composer.json`:

```
{
    ...
    "require": {
        ...
        "bankdev/logviewer": "dev-master"
        ...
    },
}
```

Update composer:

```
$ php composer.phar update

```

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

```
'providers' => array(

    ...
    'bankdev\Logviewer\LogviewerServiceProvider',

),
```

Publish package assets:

```
$ php artisan asset:publish bankdev/logviewer

```

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

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

```

(Optional) Publish package config:

```
$ php artisan config:publish bankdev/logviewer

```

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

\##Usage and Configuration

\###Usage $fileName By default, LogViewer will register itself a couple of routes:

- `logviewer` -&gt; Redirect to today's log, showing all levels.
- `logviewer/$app/$sapi/$fileName/delete` -&gt; Delete log from `$sapi` (see: [php\_sapi\_name](http://php.net/manual/en/function.php-sapi-name.php)).
- `logviewer/$app/$sapi/$fileName/$level?` -&gt; Show log from `$sapi` on `$fileName` with `$level` (if not supplied, defaults to all).

LogViewer also registers a couple filters:

- `logviewer.logs`: aggregates all the logs in your configured monitored directories and shares them with the `$logs` variable.
- `logviewer.messages`: Checks if there are success, error, or info flash messages in the session and sets the `$has_messages` variable as true or false.

\###Configuration

- `base_url`: The URL LogViewer will be available on. You can have this nested (for example: `admin/logviewer`). Default: `logviewer`.
- `filters`: Before and After filters to apply to the routes. We define no filters by default, as not everyone uses authentication or the same filter names.
    - `global`: Filters that affect the entirety of the logviewer. For example: `'global' => array('before' => 'auth'),` will apply the default Laravel `auth` filter to the logviewer, requiring a logged in user for all routes.
    - `view`: Filters that affect the viewing of log files.
    - `delete`: Filter that affect the deletion of log files.
- `log_dirs`: Associative array of log directories to monitor. Array keys are the 'names' of your applications, values are the paths to their `app/storage/logs` dir (no trailing slash). Default: `array('app' => storage_path().'/logs')`.
- `log_order`: Order log contents ascending or descending. Default: 'asc'.
- `per_page`: The number of log messages to show per page via Pagination. Default: 10.
- `view`: The name (and location) of the view used to display logs. For more information, check out the 'Advanced Usage' section for detailed information about the variables passed to this view. Default: 'logviewer::viewer'.
- `p_view`: The pagination view to use. When using Bootstrap 3 as the default for an application, the pagination would be broken within LogViewer. If you create your own view, be sure to change this if you use Bootstrap 3 (or write your own pagination view) Default: 'pagination::slider'.

Advanced Usage
--------------

[](#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:

- `$has_messages`: Boolean. The `logviewer.messages` filter determines if there are success, error, or info flash messages in the session. Used to hide the flash messages container.
- `$logs`: Array. Aggregated logs, generated by the `logviewer.logs` filter, from all monitored applications. Grouped by SAPI and application. Structure:
    - SAPI as key, value is an array with keys:
        - `sapi`: Human-readable SAPI.
        - `logs`: Application 'short name' as key, value is an array of log dates.
- `$log`: Array. Currently selected log's contents. Each message is split into an array. Structure:
    - `level`: String. The level of the log message.
    - `header`: String. The first line of the log message.
    - `stack`: String. The rest of the log message. Possibly blank, if the message did not contain a stack trace.
- `$empty`: Boolean. Whether the current log is empty or not.
- `$fileName`: String. The FileName of the currently selected log.
- `$sapi`: String. The human-readable SAPI of the currently selected log.
- `$sapi_plain`: String. The SAPI of the currently selected log. Used in the URI.
- `$url`: String. The base URL from configuration.
- `$levels`: Array. All possible log levels, per `psr/log`.
- `$path`: String. The array key of the currently selected log's application.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3703045?v=4)[BankDev](/maintainers/BankDev)[@BankDev](https://github.com/BankDev)

---

Top Contributors

[![BankDev](https://avatars.githubusercontent.com/u/3703045?v=4)](https://github.com/BankDev "BankDev (11 commits)")

### Embed Badge

![Health badge](/badges/bankdev-logviewer/health.svg)

```
[![Health](https://phpackages.com/badges/bankdev-logviewer/health.svg)](https://phpackages.com/packages/bankdev-logviewer)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
