Skip to content

Commit

Permalink
Now dashboard warns if logs are empty or if logs config is not "daily"
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoarandah committed Dec 15, 2017
1 parent 2d1781a commit 57b208d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
28 changes: 10 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ https://github.com/Laravel-Backpack/Base
composer require eduardoarandah/backpacklogviewer
php artisan vendor:publish --provider="EduardoArandaH\BackpackLogViewer\BackpackLogViewerServiceProvider"

This will install views in resources/views/vendor/log-viewer
Add to your .env file:

## Configuration
APP_LOG=daily
ARCANEDEV_LOGVIEWER_MIDDLEWARE=web,admin

Set a daily log in config/app.php
This will set your log files to "daily" and set "admin" middleware

'log' => 'daily',
## Sidebar Link

## Security
go to

Add 'admin' middleware to your .env file
resources/views/vendor/backpack/base/inc/sidebar.blade.php

ARCANEDEV_LOGVIEWER_MIDDLEWARE=web,admin
add this line

<li><a href="{{ route('log-viewer::logs.list') }}"><i class="fa fa-info-circle"></i> <span>Log Viewer</span></a></li>

## (optional) Configure Permission

Expand All @@ -42,17 +45,6 @@ Permission Manager lets you manage access to certain roles

![permissions](https://user-images.githubusercontent.com/4065733/33958159-46963c1e-e009-11e7-9c14-d9da8cb6f810.png)


## Sidebar Link

go to

resources/views/vendor/backpack/base/inc/sidebar.blade.php

add this line

<li><a href="{{ route('log-viewer::logs.list') }}"><i class="fa fa-info-circle"></i> <span>Log Viewer</span></a></li>

## (Optional) Change URL

By default, log-viewer URL is http://website/log-viewer
Expand Down
15 changes: 14 additions & 1 deletion src/assets/views/_template/master.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

<span class="text-muted pull-right hidden-xs">
LogViewer - <span class="label label-info">version {{ log_viewer()->version() }}</span>
by ARCANEDEV <sup>&copy;</sup>
</span>

<a class="logviewer-menu-item" href="{{ route('log-viewer::dashboard') }}">
Expand All @@ -18,6 +17,20 @@
</a>

</section>
@if (config('app.log')=='single')
<div class="alert alert-warning" style="margin:35px 0;">
<h1>Error: you have your logs configured as "single", please change to "daily" </h1>
<h2>Add this line to your .env file</h2>
<h3><code><strong>APP_LOG=daily</strong></code></h3>
</div>
@endif
@if (LogViewer::isEmpty())
<div class="alert alert-success" style="margin:35px 0;">
<h3>Logs empty</h3>
<p>You don't have log files</p>
<br>
</div>
@endif
@endsection
@section('after_scripts')
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.1/moment-with-locales.min.js"></script>
Expand Down

0 comments on commit 57b208d

Please sign in to comment.