PMC-880 Make the necessary changes in the core according to the "Laravel" upgrade guide (From v5.5.42 to v5.6.0)
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
parent
efc38c9400
commit
9953c196c9
22
app/Logging/CustomizeFormatter.php
Normal file
22
app/Logging/CustomizeFormatter.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Logging;
|
||||||
|
|
||||||
|
use Monolog\Formatter\LineFormatter;
|
||||||
|
|
||||||
|
class CustomizeFormatter
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Customize the given logger instance.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Log\Logger $logger
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __invoke($logger)
|
||||||
|
{
|
||||||
|
foreach ($logger->getHandlers() as $handler) {
|
||||||
|
$handler->setFormatter(new LineFormatter(null, null, true, true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,17 +50,6 @@ $app->singleton(
|
|||||||
Handler::class
|
Handler::class
|
||||||
);
|
);
|
||||||
|
|
||||||
$app->configureMonologUsing(function ($monolog) use ($app) {
|
|
||||||
$monolog->pushHandler(
|
|
||||||
(new RotatingFileHandler(
|
|
||||||
// Set the log path
|
|
||||||
$app->storagePath() . '/logs/processmaker.log',
|
|
||||||
// Set the number of daily files you want to keep
|
|
||||||
$app->make('config')->get('app.log_max_files', 5)
|
|
||||||
))->setFormatter(new LineFormatter(null, null, true, true))
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Return The Application
|
| Return The Application
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.1",
|
||||||
"laravel/framework": "5.5.*",
|
"laravel/framework": "5.6.*",
|
||||||
"luracast/restler": "^3.0",
|
"luracast/restler": "^3.0",
|
||||||
"bshaffer/oauth2-server-php": "v1.0",
|
"bshaffer/oauth2-server-php": "v1.0",
|
||||||
"colosa/pmUI": "release/3.3.1-dev",
|
"colosa/pmUI": "release/3.3.1-dev",
|
||||||
@@ -56,7 +56,6 @@
|
|||||||
"guzzlehttp/guzzle": "^6.3",
|
"guzzlehttp/guzzle": "^6.3",
|
||||||
"phpunit/phpunit": "~5.7",
|
"phpunit/phpunit": "~5.7",
|
||||||
"filp/whoops": "~2.0",
|
"filp/whoops": "~2.0",
|
||||||
"lmc/steward": "^2.2",
|
|
||||||
"behat/behat": "^3.3",
|
"behat/behat": "^3.3",
|
||||||
"behat/mink-selenium2-driver": "^1.3",
|
"behat/mink-selenium2-driver": "^1.3",
|
||||||
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2",
|
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2",
|
||||||
|
|||||||
1584
composer.lock
generated
1584
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -9,8 +9,6 @@ return [
|
|||||||
'url' => env('APP_URL', 'http://localhost'),
|
'url' => env('APP_URL', 'http://localhost'),
|
||||||
'env' => env('APP_ENV', 'production'),
|
'env' => env('APP_ENV', 'production'),
|
||||||
'debug' => env('APP_DEBUG', false),
|
'debug' => env('APP_DEBUG', false),
|
||||||
'log' => env('APP_LOG', 'single'),
|
|
||||||
'log_level' => env('APP_LOG_LEVEL', 'debug'),
|
|
||||||
'cache_lifetime' => env('APP_CACHE_LIFETIME', 60),
|
'cache_lifetime' => env('APP_CACHE_LIFETIME', 60),
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'UTC',
|
||||||
'providers' => [
|
'providers' => [
|
||||||
|
|||||||
85
config/logging.php
Normal file
85
config/logging.php
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Monolog\Handler\StreamHandler;
|
||||||
|
|
||||||
|
return [
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Default Log Channel
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| This option defines the default log channel that gets used when writing
|
||||||
|
| messages to the logs. The name specified in this option should match
|
||||||
|
| one of the channels defined in the "channels" configuration array.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'default' => env('APP_LOG', env('LOG_CHANNEL', 'daily')),
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Log Channels
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you may configure the log channels for your application. Out of
|
||||||
|
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||||
|
| you a variety of powerful log handlers / formatters to utilize.
|
||||||
|
|
|
||||||
|
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||||
|
| "errorlog", "monolog",
|
||||||
|
| "custom", "stack"
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'channels' => [
|
||||||
|
'stack' => [
|
||||||
|
'driver' => 'stack',
|
||||||
|
'channels' => ['single'],
|
||||||
|
],
|
||||||
|
|
||||||
|
'single' => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/processmaker.log'),
|
||||||
|
'level' => 'debug',
|
||||||
|
],
|
||||||
|
|
||||||
|
'daily' => [
|
||||||
|
'driver' => 'daily',
|
||||||
|
'tap' => [
|
||||||
|
App\Logging\CustomizeFormatter::class
|
||||||
|
],
|
||||||
|
'path' => storage_path('logs/processmaker.log'),
|
||||||
|
'level' => env('APP_LOG_LEVEL', 'debug'),
|
||||||
|
'days' => $app->make('config')->get('app.log_max_files', 5),
|
||||||
|
],
|
||||||
|
|
||||||
|
'slack' => [
|
||||||
|
'driver' => 'slack',
|
||||||
|
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||||
|
'username' => 'Laravel Log',
|
||||||
|
'emoji' => ':boom:',
|
||||||
|
'level' => 'critical',
|
||||||
|
],
|
||||||
|
|
||||||
|
'stderr' => [
|
||||||
|
'driver' => 'monolog',
|
||||||
|
'handler' => StreamHandler::class,
|
||||||
|
'with' => [
|
||||||
|
'stream' => 'php://stderr',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
|
'syslog' => [
|
||||||
|
'driver' => 'syslog',
|
||||||
|
'level' => 'debug',
|
||||||
|
],
|
||||||
|
|
||||||
|
'errorlog' => [
|
||||||
|
'driver' => 'errorlog',
|
||||||
|
'level' => 'debug',
|
||||||
|
],
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user