Ejemplo n.º 1
0
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton('Illuminate\\Contracts\\Http\\Kernel', 'DreamFactory\\Http\\Kernel');
$app->singleton('Illuminate\\Contracts\\Console\\Kernel', 'DreamFactory\\Console\\Kernel');
$app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', 'DreamFactory\\Exceptions\\Handler');
$app->configureMonologUsing(function ($monolog) {
    $logFile = storage_path('logs/dreamfactory.log');
    if (config('df.managed')) {
        $logFile = Managed::getLogFile();
    }
    $mode = config('app.log');
    if ($mode === 'syslog') {
        $monolog->pushHandler(new SyslogHandler('dreamfactory'));
    } else {
        if ($mode === 'single') {
            $handler = new StreamHandler($logFile);
        } else {
            if ($mode === 'errorlog') {
                $handler = new ErrorLogHandler();
            } else {
                $handler = new RotatingFileHandler($logFile, 5);
            }
        }
        $monolog->pushHandler($handler);