Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Added Lumen support and config variables are set via the .env #9

Open
wants to merge 1 commit into
base: master
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
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .php_cs
100644 → 100755
Empty file.
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified LICENSE.md
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified composer.json
100644 → 100755
Empty file.
24 changes: 12 additions & 12 deletions config/graylog2.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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'),
]
];
];
Empty file modified phpunit.xml
100644 → 100755
Empty file.
Empty file modified src/Facades/Graylog2.php
100644 → 100755
Empty file.
Empty file modified src/Graylog2.php
100644 → 100755
Empty file.
Empty file modified src/Graylog2Handler.php
100644 → 100755
Empty file.
14 changes: 12 additions & 2 deletions src/Graylog2ServiceProvider.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand All @@ -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.
*
Expand Down
Empty file modified src/Logger.php
100644 → 100755
Empty file.
Empty file modified src/Processor/ExceptionProcessor.php
100644 → 100755
Empty file.
Empty file modified src/Processor/ProcessorInterface.php
100644 → 100755
Empty file.
Empty file modified src/Processor/RequestProcessor.php
100644 → 100755
Empty file.
Empty file modified tests/AbstractTest.php
100644 → 100755
Empty file.
Empty file modified tests/Graylog2Test.php
100644 → 100755
Empty file.
Empty file modified tests/HandlerTest.php
100644 → 100755
Empty file.
Empty file modified tests/LoggerTest.php
100644 → 100755
Empty file.
Empty file modified tests/TestGraylog2Transport.php
100644 → 100755
Empty file.