Merge pull request #915 from romainneutron/error-logs

[3.8] Error logs
This commit is contained in:
Nicolas Le Goff
2014-02-03 10:47:09 -08:00
13 changed files with 25 additions and 4 deletions

View File

@@ -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());

View File

@@ -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());

View File

@@ -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')) {

View File

@@ -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()));
}
});

View File

@@ -197,16 +197,16 @@
{% set status_bit_filters = '' %}
{% for bit, data in databox.get_statusbits() if data['searchable'] %}
{% set html_status_bit %}
<div style="text-align:center;overflow:hidden;">' .
<div style="text-align:center;overflow:hidden;">
<table style="table-layout:fixed;width:90%;text-align:left;" cellspacing="0" cellpadding="0">
<tr>
<td style="width:50%" nowrap>
<input class="checkbox" db="{{ sbasId }}" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_{{ sbasId }}_off{{ sbasId }}" value="{{ sbasId }}_of{{ sbasId }}"/>
<label title="{{ data['labels_off_i18n'][app['locale.I18n']] }}" for="statusfil_{{ sbasId }}_off{{ bit }}">{% if data['img_off'] %}<img src="'{{ datas['img_off'] }}" title="{{ datas['labels_off_i18n'][app['locale.I18n']] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labels_off_i18n'][app['locale.I18n']] }}</label>
<label title="{{ data['labels_off_i18n'][app['locale.I18n']] }}" for="statusfil_{{ sbasId }}_off{{ bit }}">{% if data['img_off'] %}<img src="'{{ data['img_off'] }}" title="{{ data['labels_off_i18n'][app['locale.I18n']] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labels_off_i18n'][app['locale.I18n']] }}</label>
</td>
<td style="width:50%" nowrap>
<input class="checkbox" db="{{ sbasId }}" onchange="checkFilters();" type="checkbox" name="status[]" id="statusfil_{{ sbasId }}_on{{ sbasId }}" value="{{ sbasId }}_on{{ sbasId }}"/>
<label title="{{ data['labels_on_i18n'][app['locale.I18n']] }}" for="statusfil_{{ sbasId }}_on{{ bit }}">{% if data['img_on']%}<img src="{{ datas['img_on'] }}" title="{{ datas['labels_on_i18n'][app['locale.I18n']] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labels_on_i18n'][app['locale.I18n']] }}</label>
<label title="{{ data['labels_on_i18n'][app['locale.I18n']] }}" for="statusfil_{{ sbasId }}_on{{ bit }}">{% if data['img_on']%}<img src="{{ data['img_on'] }}" title="{{ data['labels_on_i18n'][app['locale.I18n']] }}" style="width:16px;height:16px;vertical-align:bottom" />{% endif %}{{ data['labels_on_i18n'][app['locale.I18n']] }}</label>
</td>
</tr>
</table>

View File

Before

Width:  |  Height:  |  Size: 64 B

After

Width:  |  Height:  |  Size: 64 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B