diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index b5710d03aa..428b9392ba 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -105,6 +105,8 @@ use Alchemy\Phrasea\Twig\JSUniqueID; use Alchemy\Phrasea\Twig\Camelize; use Alchemy\Phrasea\Twig\BytesConverter; use FFMpeg\FFMpegServiceProvider; +use Monolog\Logger; +use Monolog\Processor\IntrospectionProcessor; use Neutron\Silex\Provider\ImagineServiceProvider; use MediaVorus\MediaVorusServiceProvider; use MediaVorus\Utils\RawImageMimeTypeGuesser; @@ -250,6 +252,11 @@ class Application extends SilexApplication $this['monolog.handler'] = $this->share(function () { return new NullHandler(); }); + $this['monolog'] = $this->share($this->extend('monolog', function (Logger $monolog) { + $monolog->pushProcessor(new IntrospectionProcessor()); + + return $monolog; + })); $this->register(new MP4BoxServiceProvider()); $this->register(new NotificationDelivererServiceProvider()); $this->register(new ORMServiceProvider()); diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index 98034a0875..431c81bba3 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -19,6 +19,8 @@ use Alchemy\Phrasea\Core\Event\ApiLoadEndEvent; use Alchemy\Phrasea\Core\Event\ApiLoadStartEvent; use Alchemy\Phrasea\Core\Event\Subscriber\ApiOauth2ErrorsSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\ApiExceptionHandlerSubscriber; +use Monolog\Logger; +use Monolog\Processor\WebProcessor; use Silex\Application as SilexApplication; use Symfony\Component\HttpFoundation\Request; @@ -30,6 +32,11 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app['exception_handler'] = $app->share(function ($app) { return new ApiExceptionHandlerSubscriber($app); }); + $app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) { + $monolog->pushProcessor(new WebProcessor()); + + return $monolog; + })); $app->register(new \API_V1_Timer()); $app['dispatcher']->dispatch(PhraseaEvents::API_LOAD_START, new ApiLoadStartEvent()); diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 2f51f99379..ee8d47e912 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -17,6 +17,8 @@ use Alchemy\Phrasea\Core\Event\Subscriber\BridgeExceptionSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\FirewallSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\JsonRequestSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\DebuggerSubscriber; +use Monolog\Logger; +use Monolog\Processor\WebProcessor; use Silex\Provider\WebProfilerServiceProvider; use Symfony\Component\HttpFoundation\Request; @@ -28,6 +30,11 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app['exception_handler'] = $app->share(function ($app) { return new PhraseaExceptionHandlerSubscriber($app['phraseanet.exception_handler']); }); + $app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) { + $monolog->pushProcessor(new WebProcessor()); + + return $monolog; + })); $app->before(function (Request $request) use ($app) { if (0 === strpos($request->getPathInfo(), '/setup')) { diff --git a/lib/Alchemy/Phrasea/Controller/Datafiles.php b/lib/Alchemy/Phrasea/Controller/Datafiles.php index be7a734321..49b5848efa 100644 --- a/lib/Alchemy/Phrasea/Controller/Datafiles.php +++ b/lib/Alchemy/Phrasea/Controller/Datafiles.php @@ -33,7 +33,7 @@ class Datafiles extends AbstractDelivery $controllers->before(function (Request $request) use ($app) { if (!$app['authentication']->isAuthenticated()) { - $app->abort(403, 'You are not autorized to see this'); + $app->abort(403, sprintf('You are not authorized to access %s', $request->getRequestUri())); } }); diff --git a/templates/web/client/index.html.twig b/templates/web/client/index.html.twig index 7e9ffae0ec..dfa0ca581d 100644 --- a/templates/web/client/index.html.twig +++ b/templates/web/client/index.html.twig @@ -197,16 +197,16 @@ {% set status_bit_filters = '' %} {% for bit, data in databox.get_statusbits() if data['searchable'] %} {% set html_status_bit %} -