Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 7481c06

Browse files
committed
Setup LDAP logging
1 parent 3f4df71 commit 7481c06

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/AdldapServiceProvider.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Adldap\Connections\Provider;
99
use Adldap\Connections\ConnectionInterface;
1010
use Illuminate\Container\Container;
11-
use Illuminate\Support\Facades\Log;
11+
use Illuminate\Support\Facades\Config;
1212
use Illuminate\Support\ServiceProvider;
1313

1414
class AdldapServiceProvider extends ServiceProvider
@@ -28,6 +28,10 @@ class AdldapServiceProvider extends ServiceProvider
2828
*/
2929
public function boot()
3030
{
31+
if (Config::get('ldap.logging')) {
32+
Adldap::setLogger(logger());
33+
}
34+
3135
if ($this->isLumen()) {
3236
return;
3337
}
@@ -104,7 +108,7 @@ protected function addProviders(Adldap $adldap, array $connections = [])
104108
// We'll catch and log bind exceptions so
105109
// any connection issues fail gracefully
106110
// in our application.
107-
Log::error($e);
111+
logger()->error($e);
108112
}
109113
}
110114

0 commit comments

Comments
 (0)