Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Merge branch '1.2'
Browse files Browse the repository at this point in the history
* 1.2:
  fixed CS
  Update monolog provider for support permissions
  • Loading branch information
fabpot committed May 4, 2014
2 parents ae8f9d4 + 6fdeeba commit b0aa888
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/providers/monolog.rst
Expand Up @@ -12,6 +12,8 @@ Parameters
----------

* **monolog.logfile**: File where logs are written to.
* **monolog.bubble** = (optional) Whether the messages that are handled can bubble up the stack or not.
* **monolog.permission** = (optional) File permissions default (null), nothing change.

* **monolog.level** (optional): Level of logging, defaults
to ``DEBUG``. Must be one of ``Logger::DEBUG``, ``Logger::INFO``,
Expand Down
4 changes: 3 additions & 1 deletion src/Silex/Provider/MonologServiceProvider.php
Expand Up @@ -61,7 +61,7 @@ public function register(Container $app)
$app['monolog.handler'] = function () use ($app) {
$level = MonologServiceProvider::translateLevel($app['monolog.level']);

return new StreamHandler($app['monolog.logfile'], $level);
return new StreamHandler($app['monolog.logfile'], $level, $app['monolog.bubble'], $app['monolog.permission']);
};

$app['monolog.level'] = function () {
Expand All @@ -73,6 +73,8 @@ public function register(Container $app)
};

$app['monolog.name'] = 'myapp';
$app['monolog.bubble'] = true;
$app['monolog.permission'] = null;
}

public function boot(Application $app)
Expand Down

0 comments on commit b0aa888

Please sign in to comment.