diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.php_cs b/.php_cs old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 diff --git a/config/graylog2.php b/config/graylog2.php old mode 100644 new mode 100755 index 0a0e203..4ef65f2 --- a/config/graylog2.php +++ b/config/graylog2.php @@ -2,18 +2,18 @@ return [ - 'enabled' => true, + 'enabled' => env('GRAYLOG_ENABLED', true), - 'log_level' => 'debug', + 'log_level' => env('GRAYLOG_LOG_LEVEL', 'debug'), // Log HTTP requests with exceptions - 'log_requests' => true, + 'log_requests' => env('GRAYLOG_LOG_REQUESTS', true), // Log HTTP Request GET data - 'log_request_get_data' => false, + 'log_request_get_data' => env('GRAYLOG_LOG_REQUESTS_GET_DATA', false), // Log HTTP Request POST data - 'log_request_post_data' => false, + 'log_request_post_data' => env('GRAYLOG_LOG_REQUESTS_POST_DATA', false), // Filter out some sensitive post parameters 'disallowed_post_parameters' => ['password', 'username'], @@ -24,20 +24,20 @@ * exception information is also included in the 'exception' * field. */ - 'stack_trace_in_full_message' => false, + 'stack_trace_in_full_message' => ENV('GRAYLOG_STACK_TRACE', false), 'connection' => [ - 'host' => '127.0.0.1', - 'port' => '12201', + 'host' => env('GRAYLOG_HOST', '127.0.0.1'), + 'port' => env('GRAYLOG_PORT', '12201'), /* - * Choose between UDP and TCP transport. + * Choose between UDP and TCP transport. * UDP transports won't throw exceptions on transport errors, * but message reception by the Graylog server is not guaranteed. */ - 'type' => 'UDP', + 'type' => env('GRAYLOG_TRANSPORT_TYPE', 'UDP'), // Set to UdpTransport::CHUNK_SIZE_LAN as a default - 'chunk_size' => '8154', + 'chunk_size' => env('GRAYLOG_CHUNK_SIZE', '8154'), ] -]; \ No newline at end of file +]; diff --git a/phpunit.xml b/phpunit.xml old mode 100644 new mode 100755 diff --git a/src/Facades/Graylog2.php b/src/Facades/Graylog2.php old mode 100644 new mode 100755 diff --git a/src/Graylog2.php b/src/Graylog2.php old mode 100644 new mode 100755 diff --git a/src/Graylog2Handler.php b/src/Graylog2Handler.php old mode 100644 new mode 100755 diff --git a/src/Graylog2ServiceProvider.php b/src/Graylog2ServiceProvider.php old mode 100644 new mode 100755 index 4d57217..272f200 --- a/src/Graylog2ServiceProvider.php +++ b/src/Graylog2ServiceProvider.php @@ -14,8 +14,10 @@ public function boot() { // Publish configuration file $this->publishes([ - __DIR__.'/../config/graylog2.php' => $this->app->configPath().'/graylog2.php', + __DIR__.'/../config/graylog2.php' => base_path('config/graylog2.php'), ]); + + $this->mergeConfigFrom(__DIR__.'/../config/graylog2.php', 'graylog2'); } /** @@ -26,10 +28,18 @@ public function register() $this->app->singleton('graylog2', Graylog2::class); // Register handler - $monoLog = Log::getMonolog(); + $monoLog = $this->logger(); $monoLog->pushHandler(new Graylog2Handler(config('graylog2.log_level', 'debug'))); } + /** + * @return \Monolog\Logger + */ + protected function logger() + { + return app('log'); + } + /** * Get the services provided by the provider. * diff --git a/src/Logger.php b/src/Logger.php old mode 100644 new mode 100755 diff --git a/src/Processor/ExceptionProcessor.php b/src/Processor/ExceptionProcessor.php old mode 100644 new mode 100755 diff --git a/src/Processor/ProcessorInterface.php b/src/Processor/ProcessorInterface.php old mode 100644 new mode 100755 diff --git a/src/Processor/RequestProcessor.php b/src/Processor/RequestProcessor.php old mode 100644 new mode 100755 diff --git a/tests/AbstractTest.php b/tests/AbstractTest.php old mode 100644 new mode 100755 diff --git a/tests/Graylog2Test.php b/tests/Graylog2Test.php old mode 100644 new mode 100755 diff --git a/tests/HandlerTest.php b/tests/HandlerTest.php old mode 100644 new mode 100755 diff --git a/tests/LoggerTest.php b/tests/LoggerTest.php old mode 100644 new mode 100755 diff --git a/tests/TestGraylog2Transport.php b/tests/TestGraylog2Transport.php old mode 100644 new mode 100755