Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D shitikov/hw8 #511

Open
wants to merge 4 commits into
base: DShitikov/hw7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

LOG_VIEWER_ENABLE=true

LOG_SLACK_WEBHOOK_URL_ERROR=
LOG_SLACK_WEBHOOK_URL_INFO=
LOG_SLACK_WEBHOOK_URL_WARNING=
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
## Build Setup

``` bash
# create .env
cp .env.example .env

# install dependencies
composer install
npm install

# run migrations
php artisan migrate

# build for development
npm run dev

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "MIT",
"require": {
"php": "^7.2.5",
"arcanedev/log-viewer": "^7.0",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^1.0",
"guzzlehttp/guzzle": "^6.3",
Expand Down
126 changes: 125 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
/*
* Package Service Providers...
*/
Arcanedev\LogViewer\LogViewerServiceProvider::class,

/*
* Application Service Providers...
Expand Down
141 changes: 141 additions & 0 deletions config/log-viewer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?php

use Arcanedev\LogViewer\Contracts\Utilities\Filesystem;

return [

/* -----------------------------------------------------------------
| Log files storage path
| -----------------------------------------------------------------
*/

'storage-path' => storage_path('logs'),

/* -----------------------------------------------------------------
| Log files pattern
| -----------------------------------------------------------------
*/

'pattern' => [
'prefix' => Filesystem::PATTERN_PREFIX, // 'laravel-'
'date' => Filesystem::PATTERN_DATE, // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
'extension' => Filesystem::PATTERN_EXTENSION, // '.log'
],

/* -----------------------------------------------------------------
| Locale
| -----------------------------------------------------------------
| Supported locales :
| 'auto', 'ar', 'bg', 'de', 'en', 'es', 'et', 'fa', 'fr', 'hu', 'hy', 'id', 'it', 'ja', 'ko', 'nl',
| 'pl', 'pt-BR', 'ro', 'ru', 'sv', 'th', 'tr', 'zh-TW', 'zh'
*/

'locale' => 'auto',

/* -----------------------------------------------------------------
| Theme
| -----------------------------------------------------------------
| Supported themes :
| 'bootstrap-3', 'bootstrap-4'
| Make your own theme by adding a folder to the views directory and specifying it here.
*/

'theme' => 'bootstrap-4',

/* -----------------------------------------------------------------
| Route settings
| -----------------------------------------------------------------
*/

'route' => [
'enabled' => env('LOG_VIEWER_ENABLE', false),

'attributes' => [
'prefix' => 'log-viewer',

'middleware' => env('ARCANEDEV_LOGVIEWER_MIDDLEWARE') ? explode(',', env('ARCANEDEV_LOGVIEWER_MIDDLEWARE')) : null,
],
],

/* -----------------------------------------------------------------
| Log entries per page
| -----------------------------------------------------------------
| This defines how many logs & entries are displayed per page.
*/

'per-page' => 30,

/* -----------------------------------------------------------------
| Download settings
| -----------------------------------------------------------------
*/

'download' => [
'prefix' => 'laravel-',

'extension' => 'log',
],

/* -----------------------------------------------------------------
| Menu settings
| -----------------------------------------------------------------
*/

'menu' => [
'filter-route' => 'log-viewer::logs.filter',

'icons-enabled' => true,
],

/* -----------------------------------------------------------------
| Icons
| -----------------------------------------------------------------
*/

'icons' => [
/**
* Font awesome >= 4.3
* http://fontawesome.io/icons/
*/
'all' => 'fa fa-fw fa-list', // http://fontawesome.io/icon/list/
'emergency' => 'fa fa-fw fa-bug', // http://fontawesome.io/icon/bug/
'alert' => 'fa fa-fw fa-bullhorn', // http://fontawesome.io/icon/bullhorn/
'critical' => 'fa fa-fw fa-heartbeat', // http://fontawesome.io/icon/heartbeat/
'error' => 'fa fa-fw fa-times-circle', // http://fontawesome.io/icon/times-circle/
'warning' => 'fa fa-fw fa-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/
'notice' => 'fa fa-fw fa-exclamation-circle', // http://fontawesome.io/icon/exclamation-circle/
'info' => 'fa fa-fw fa-info-circle', // http://fontawesome.io/icon/info-circle/
'debug' => 'fa fa-fw fa-life-ring', // http://fontawesome.io/icon/life-ring/
],

/* -----------------------------------------------------------------
| Colors
| -----------------------------------------------------------------
*/

'colors' => [
'levels' => [
'empty' => '#D1D1D1',
'all' => '#8A8A8A',
'emergency' => '#B71C1C',
'alert' => '#D32F2F',
'critical' => '#F44336',
'error' => '#FF5722',
'warning' => '#FF9100',
'notice' => '#4CAF50',
'info' => '#1976D2',
'debug' => '#90CAF9',
],
],

/* -----------------------------------------------------------------
| Strings to highlight in stack trace
| -----------------------------------------------------------------
*/

'highlight' => [
'^#\d+',
'^Stack trace:',
],

];
26 changes: 21 additions & 5 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
'channels' => ['slack-error', 'slack-warning', 'slack-info', 'daily'],
'ignore_exceptions' => true,
],

'single' => [
Expand All @@ -54,12 +54,28 @@
'days' => 14,
],

'slack' => [
'slack-error' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'url' => env('LOG_SLACK_WEBHOOK_URL_ERROR'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
'level' => 'error',
],

'slack-warning' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL_WARNING'),
'username' => 'Laravel Log',
'emoji' => ':warning:',
'level' => 'warning',
],

'slack-info' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL_INFO'),
'username' => 'Laravel Log',
'emoji' => ':information_source:',
'level' => 'info',
],

'papertrail' => [
Expand Down
13 changes: 13 additions & 0 deletions resources/lang/vendor/log-viewer/ar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Date": "تاريخ",
"The list of logs is empty!": "قائمة سجلات فارغة!",
"All": "الجميع",
"Emergency": "حالات الطوارئ",
"Alert": "إنذار",
"Critical": "حرج",
"Error": "خطأ",
"Warning": "تحذير",
"Notice": "ملاحظة",
"Info": "المعلومات",
"Debug": "التصحيح"
}
13 changes: 13 additions & 0 deletions resources/lang/vendor/log-viewer/bg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"Date": "Дата",
"The list of logs is empty!": "Не са намерени логове!",
"All": "Всички",
"Emergency": "Emergency",
"Alert": "Alert",
"Critical": "Critical",
"Error": "Error",
"Warning": "Warning",
"Notice": "Notice",
"Info": "Info",
"Debug": "Debug"
}
Loading