Commit 14487c1f authored by Igor Wiedler's avatar Igor Wiedler

[MonologExtension] monolog.name and monolog.level options

parent 8022d089
......@@ -24,7 +24,7 @@ class MonologExtension implements ExtensionInterface
public function register(Application $app)
{
$app['monolog'] = $app->share(function () use ($app) {
$log = new Logger('myapp');
$log = new Logger(isset($app['monolog.name']) ? $app['monolog.name'] : 'myapp');
$app['monolog.configure']($log);
......@@ -32,7 +32,8 @@ class MonologExtension implements ExtensionInterface
});
$app['monolog.configure'] = $app->protect(function ($log) use ($app) {
$log->pushHandler(new StreamHandler($app['monolog.logfile'], Logger::DEBUG));
$level = isset($app['monolog.level']) ? $app['monolog.level'] : Logger::DEBUG;
$log->pushHandler(new StreamHandler($app['monolog.logfile'], $level));
});
if (isset($app['monolog.class_path'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment