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

Commit 1ae48b5

Browse files
authored
Merge pull request #8 from alberto-bottarini/master
Improve ServiceProvider
2 parents 4036180 + 5349f0c commit 1ae48b5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Graylog2ServiceProvider.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
class Graylog2ServiceProvider extends ServiceProvider
99
{
10+
11+
protected $defer = true;
12+
1013
/**
1114
* Bootstrap the application events.
1215
*/
@@ -16,6 +19,10 @@ public function boot()
1619
$this->publishes([
1720
__DIR__.'/../config/graylog2.php' => $this->app->configPath().'/graylog2.php',
1821
]);
22+
23+
// Register handler
24+
$monoLog = Log::getMonolog();
25+
$monoLog->pushHandler(new Graylog2Handler(config('graylog2.log_level', 'debug')));
1926
}
2027

2128
/**
@@ -24,10 +31,6 @@ public function boot()
2431
public function register()
2532
{
2633
$this->app->singleton('graylog2', Graylog2::class);
27-
28-
// Register handler
29-
$monoLog = Log::getMonolog();
30-
$monoLog->pushHandler(new Graylog2Handler(config('graylog2.log_level', 'debug')));
3134
}
3235

3336
/**

0 commit comments

Comments
 (0)