Describe the feature you'd like:
Make Log Level configurable.
How?
Currently inside the Loggable Trait:
<?php
namespace LdapRecord\Laravel\Events;
use Illuminate\Support\Facades\Config;
trait Loggable
{
/**
* Get the level of log message (i.e. info, alert, critical).
*/
public function getLogLevel(): string
{
return 'info';
}
/**
* Determine if event should be logged.
*/
public function shouldLogEvent(): bool
{
return Config::get('ldap.logging.enabled', false);
}
}
Change the getLogLevel-function to:
/**
* Get the level of log message (i.e. info, alert, critical).
*/
public function getLogLevel(): string
{
return Config::get('ldap.logging.level', 'info');
}
As well as adding a new config value inside the config/ldap.php file:
Why?
It would be nice to be able to set the logging level so it can be adjusted to other application-wide loggings. Maybe developers want to use the debug-Log-Level as default for their application's logs - as well as for ldap logging.
Describe the feature you'd like: Make Log Level configurable.
How? Currently inside the
Loggable
Trait:Change the
getLogLevel
-function to:As well as adding a new config value inside the config/ldap.php file:
Why? It would be nice to be able to set the logging level so it can be adjusted to other application-wide loggings. Maybe developers want to use the
debug
-Log-Level as default for their application's logs - as well as for ldap logging.