From 7b694777123218a8445b073ab73335396b80a677 Mon Sep 17 00:00:00 2001
From: Arno Kaimbacher
Date: Thu, 14 May 2020 20:09:21 +0200
Subject: [PATCH] - display project if defined on landing page - delete log
settings in app.php (added logging.php)
---
app/Library/Xml/XmlModel.php | 1 +
config/app.php | 12 +--
config/logging.php | 84 +++++++++++++++++++
.../views/frontend/dataset/show.blade.php | 6 ++
4 files changed, 97 insertions(+), 6 deletions(-)
create mode 100644 config/logging.php
diff --git a/app/Library/Xml/XmlModel.php b/app/Library/Xml/XmlModel.php
index 186ab83..176b23c 100644
--- a/app/Library/Xml/XmlModel.php
+++ b/app/Library/Xml/XmlModel.php
@@ -17,6 +17,7 @@ namespace App\Library\Xml;
use App\Models\XmlCache;
use Illuminate\Support\Facades\Log;
+use \Exception;
class XmlModel
{
diff --git a/config/app.php b/config/app.php
index b1d84d3..73ca162 100755
--- a/config/app.php
+++ b/config/app.php
@@ -28,7 +28,7 @@ return [
|
*/
- 'env' => env('APP_ENV', 'debug'),
+ 'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
@@ -41,7 +41,7 @@ return [
|
*/
- 'debug' => env('APP_DEBUG', true),
+ 'debug' => env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
@@ -123,9 +123,9 @@ return [
|
*/
- 'log' => 'single',
- //debug, info, notice, warning, error, critical, alert, emergency.
- 'log_level' => env('APP_LOG_LEVEL', 'debug'),
+ // 'log' => 'single',
+ // //debug, info, notice, warning, error, critical, alert, emergency.
+ // 'log_level' => env('APP_LOG_LEVEL', 'debug'),
/*
|--------------------------------------------------------------------------
@@ -223,7 +223,7 @@ return [
'Input' => 'Illuminate\Support\Facades\Input',
// 'Inspiring' => 'Illuminate\Foundation\Inspiring',
'Lang' => 'Illuminate\Support\Facades\Lang',
- 'Log' => 'Illuminate\Support\Facades\Log',
+ 'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => 'Illuminate\Support\Facades\Mail',
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => 'Illuminate\Support\Facades\Password',
diff --git a/config/logging.php b/config/logging.php
new file mode 100644
index 0000000..a50c061
--- /dev/null
+++ b/config/logging.php
@@ -0,0 +1,84 @@
+ env('LOG_CHANNEL', 'stack'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Log Channels
+ |--------------------------------------------------------------------------
+ |
+ | Here you may configure the log channels for your application. Out of
+ | the box, Laravel uses the Monolog PHP logging library. This gives
+ | you a variety of powerful log handlers / formatters to utilize.
+ |
+ | Available Drivers: "single", "daily", "slack", "syslog",
+ | "errorlog", "monolog",
+ | "custom", "stack"
+ |
+ */
+
+ 'channels' => [
+ 'stack' => [
+ 'driver' => 'stack',
+ 'channels' => ['single'],
+ 'ignore_exceptions' => false,
+ ],
+
+ ////debug, info, notice, warning, error, critical, alert, emergency.
+ 'single' => [
+ 'driver' => 'single',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => 'error',
+ ],
+
+ 'daily' => [
+ 'driver' => 'daily',
+ 'path' => storage_path('logs/laravel.log'),
+ 'level' => 'debug',
+ 'days' => 7,
+ ],
+
+ 'slack' => [
+ 'driver' => 'slack',
+ 'url' => env('LOG_SLACK_WEBHOOK_URL'),
+ 'username' => 'Laravel Log',
+ 'emoji' => ':boom:',
+ 'level' => 'critical',
+ ],
+
+ 'stderr' => [
+ 'driver' => 'monolog',
+ 'handler' => StreamHandler::class,
+ 'with' => [
+ 'stream' => 'php://stderr',
+ ],
+ ],
+
+ 'syslog' => [
+ 'driver' => 'syslog',
+ 'level' => 'debug',
+ ],
+
+ 'errorlog' => [
+ 'driver' => 'errorlog',
+ 'level' => 'debug',
+ ],
+ ],
+
+];
diff --git a/resources/views/frontend/dataset/show.blade.php b/resources/views/frontend/dataset/show.blade.php
index e26c120..34dd615 100644
--- a/resources/views/frontend/dataset/show.blade.php
+++ b/resources/views/frontend/dataset/show.blade.php
@@ -93,6 +93,12 @@
@endforeach
+ @endif
+
+ @if($dataset->project()->exists())
+
+ Projekt: {{ $dataset->project->name }}
+
@endif
Erstellungsjahr: {{ $dataset->server_date_published->year }}