Added config to log in filesystem while running API tests

This commit is contained in:
Alejandro Celaya 2021-02-13 11:40:19 +01:00
parent c372a498cc
commit 9feb72235a
2 changed files with 28 additions and 0 deletions

View File

@ -3,6 +3,8 @@ export APP_ENV=test
export DB_DRIVER=postgres
export TEST_ENV=api
rm -rf data/log/api-tests
# Try to stop server just in case it hanged in last execution
vendor/bin/laminas mezzio:swoole:stop

View File

@ -9,6 +9,8 @@ use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\Diactoros\Response\EmptyResponse;
use Laminas\ServiceManager\Factory\InvokableFactory;
use Laminas\Stdlib\Glob;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Logger;
use PDO;
use PHPUnit\Runner\Version;
use SebastianBergmann\CodeCoverage\CodeCoverage;
@ -163,4 +165,28 @@ return [
],
],
'logger' => [
'Shlink' => [
'handlers' => [
'shlink_handler' => [
'params' => [
'level' => Logger::DEBUG,
'filename' => 'data/log/api-tests/shlink_log.log',
],
],
],
],
'Access' => [
'handlers' => [
'access_handler' => [
'name' => RotatingFileHandler::class,
'params' => [
'level' => Logger::DEBUG,
'filename' => 'data/log/api-tests/access_log.log',
],
],
],
],
],
];