From 54adff50b9d5995614e772228de3ae2e9e1e97a4 Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Fri, 10 May 2019 12:15:59 +0400 Subject: [PATCH 1/5] add monolog handler --- lib/Alchemy/Phrasea/Application.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index bba5aae23e..f586a4f93a 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -92,9 +92,12 @@ use Alchemy\WorkerProvider\WorkerServiceProvider; use Doctrine\DBAL\Event\ConnectionEventArgs; use MediaVorus\Media\MediaInterface; use MediaVorus\MediaVorus; +use Monolog\Handler\ErrorLogHandler; use Monolog\Handler\RotatingFileHandler; +use Monolog\Handler\StreamHandler; use Monolog\Logger; use Neutron\ReCaptcha\ReCaptchaServiceProvider; +use Psr\Log\LoggerInterface; use Silex\Application as SilexApplication; use Silex\Application\TranslationTrait; use Silex\Application\UrlGeneratorTrait; @@ -253,6 +256,23 @@ class Application extends SilexApplication $this->register(new OrderServiceProvider()); $this->register(new WebhookServiceProvider()); + $this['monolog'] = $this->share( + $this->extend('monolog', function (LoggerInterface $logger, Application $app) { + + $logger->pushHandler(new ErrorLogHandler( + ErrorLogHandler::SAPI, + Logger::ERROR + )); + + $logger->pushHandler(new StreamHandler( + fopen('php://stderr', 'w'), + Logger::ERROR + )); + + return $logger; + }) + ); + $this['phraseanet.exception_handler'] = $this->share(function ($app) { /** @var PhraseaExceptionHandler $handler */ $handler = PhraseaExceptionHandler::register($app['debug']); From ca5deb6455950353ba62d47713b414881f3679e4 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Fri, 10 May 2019 15:46:20 +0200 Subject: [PATCH 2/5] PHRAS-2561 #comment remove npm install add yarn Install --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8865393a6d..66fa0bf775 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,7 +56,7 @@ jobs: # This is based on your 1.0 configuration file or project settings - run: node -v - run: npm -v - - run: npm install + - run: yarn install - run: if [[ ! -e elasticsearch-2.3.3 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.3.3.tar.gz && tar -xvf elasticsearch-2.3.3.tar.gz && elasticsearch-2.3.3/bin/plugin install analysis-icu; fi - run: command: elasticsearch-2.3.3/bin/elasticsearch From c0f2f16dd085e4bc4aeec899f5247a2a43a0f8ed Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Fri, 10 May 2019 18:02:02 +0200 Subject: [PATCH 3/5] PHRAS-2561 #comment update yarn version --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 66fa0bf775..5285d8c65f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,7 @@ jobs: # This is based on your 1.0 configuration file or project settings - run: node -v - run: npm -v + - run: npm install -g yarn - run: yarn install - run: if [[ ! -e elasticsearch-2.3.3 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.3.3.tar.gz && tar -xvf elasticsearch-2.3.3.tar.gz && elasticsearch-2.3.3/bin/plugin install analysis-icu; fi - run: From e4db07278b2dfb9cc489e931b9b68d2dab9c81b9 Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Fri, 10 May 2019 19:57:54 +0200 Subject: [PATCH 4/5] PHRAS-2561 #comment force using specific yarn version --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5285d8c65f..b5499305fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,8 +56,7 @@ jobs: # This is based on your 1.0 configuration file or project settings - run: node -v - run: npm -v - - run: npm install -g yarn - - run: yarn install + - run: /opt/circleci/nodejs/v10.12.0/bin/yarn install - run: if [[ ! -e elasticsearch-2.3.3 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.3.3.tar.gz && tar -xvf elasticsearch-2.3.3.tar.gz && elasticsearch-2.3.3/bin/plugin install analysis-icu; fi - run: command: elasticsearch-2.3.3/bin/elasticsearch From b19f36516da3cded8c884f9424e4d77c5a0ad26b Mon Sep 17 00:00:00 2001 From: Nicolas Maillat Date: Fri, 10 May 2019 20:24:10 +0200 Subject: [PATCH 5/5] PHRAS-2561 installing yarn PHRAS-2561 #comment installing yarn for nodes version 10.12.0 --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b5499305fc..c6a4198590 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -56,6 +56,7 @@ jobs: # This is based on your 1.0 configuration file or project settings - run: node -v - run: npm -v + - run: npm install -g yarn - run: /opt/circleci/nodejs/v10.12.0/bin/yarn install - run: if [[ ! -e elasticsearch-2.3.3 ]]; then wget --no-check-certificate https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.3.3.tar.gz && tar -xvf elasticsearch-2.3.3.tar.gz && elasticsearch-2.3.3/bin/plugin install analysis-icu; fi - run: