https://github.com/mojtabaahn/laravel-web-logs
View Laravel File-Based Logs In Web
https://github.com/mojtabaahn/laravel-web-logs
debugging-tools dev dev-tools developer-tools laravel lumen php vue web
Last synced: 11 days ago
JSON representation
View Laravel File-Based Logs In Web
- Host: GitHub
- URL: https://github.com/mojtabaahn/laravel-web-logs
- Owner: mojtabaahn
- License: mit
- Archived: true
- Created: 2021-05-14T12:21:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-08T20:40:26.000Z (over 3 years ago)
- Last Synced: 2026-01-13T21:40:48.735Z (12 days ago)
- Topics: debugging-tools, dev, dev-tools, developer-tools, laravel, lumen, php, vue, web
- Language: PHP
- Homepage:
- Size: 5.08 MB
- Stars: 158
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# View Laravel/Lumen logs in browser.




## Disclaimer
This package is simply a lightweight web interface for Laravel and Lumen file-based logs.
If you need an advanced debugging tool consider trying [Telescope](https://laravel.com/docs/8.x/telescope), [Debugbar](https://github.com/barryvdh/laravel-debugbar), [Clockwork](https://github.com/itsgoingd/clockwork) or [Ray](https://myray.app/)
And if you need an error tracking software consider trying [Sentry](https://sentry.io/) and [Bugsnag](https://www.bugsnag.com/).
## Screen Shot

## Installation
You can install the package via composer:
```bash
composer require mojtabaahn/laravel-web-logs
```
Now publish package assets using this command:
```bash
php artisan vendor:publish --tag="web-logs-assets"
```
Optionally, you can publish the config file of the package.
```bash
php artisan vendor:publish --provider="Mojtabaahn\LaravelWebLogs\Providers\LaravelWebLogsServiceProvider" --tag="config"
```
## Usage
Visit the `web-logs/` route use the package. You can change this in the config file.
## Configuration
This is the contents of the published config file:
```php
use Mojtabaahn\LaravelWebLogs\Http\Middlewares\Authorize;
return [
/*
|--------------------------------------------------------------------------
| Dashboard Enabled
|--------------------------------------------------------------------------
|
| Here you may specify either dashboard is enabled or not
|
*/
'enabled' => env('WEB_LOGS_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Route Group Attributes
|--------------------------------------------------------------------------
|
| This is the array configuring package route attributes. feel free
| to edit route prefixes, middlewares and anything else.
|
| In case you want to add authorization using default auth driver,
| uncomment web middleware.
|
*/
'route_group_attributes' => [
'prefix' => env('WEB_LOGS_PATH', 'web-logs'),
'middleware' => [
// 'web',
Authorize::class,
],
],
/*
|--------------------------------------------------------------------------
| Chunk Size
|--------------------------------------------------------------------------
|
| On each request from dashboard to it's back-end how many logs should
| it read of specified log file. Setting this option to a big number
| may reduce dashboard performance!
|
*/
'chunk_size' => env('WEB_LOGS_CHUNK_SIZE', 10),
/*
|--------------------------------------------------------------------------
| Search Path
|--------------------------------------------------------------------------
|
| Use this property to customize logs directory where package should
| look for log files.
|
*/
'search_path' => storage_path('logs'),
];
```
## Authorization
Web Logs is enabled by default for all users and guests. In case you want to authorize users before accessing it you must register a `viewWebLogs` ability. A good place to do this is in the `AuthServiceProvider` that ships with Laravel.
```php
public function boot()
{
$this->registerPolicies();
Gate::define('viewWebLogs', function ($user = null) {
// return true if access to web logs is allowed
});
}
```
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.