| Server IP : 54.233.248.239 / Your IP : 172.28.20.13 Web Server : Apache System : Linux ip-172-28-29-189 6.5.0-1014-aws #14~22.04.1-Ubuntu SMP Thu Feb 15 15:27:06 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.2.34-43+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/vinumday2_0/vendor/laravel/framework/src/Illuminate/Log/ |
Upload File : |
<?php
namespace Illuminate\Log;
use Monolog\Logger as Monolog;
use Illuminate\Support\ServiceProvider;
class LogServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->singleton('log', function () {
return $this->createLogger();
});
}
/**
* Create the logger.
*
* @return \Illuminate\Log\Writer
*/
public function createLogger()
{
$log = new Writer(
new Monolog($this->channel()), $this->app['events']
);
if ($this->app->hasMonologConfigurator()) {
call_user_func($this->app->getMonologConfigurator(), $log->getMonolog());
} else {
$this->configureHandler($log);
}
return $log;
}
/**
* Get the name of the log "channel".
*
* @return string
*/
protected function channel()
{
return $this->app->bound('env') ? $this->app->environment() : 'production';
}
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureHandler(Writer $log)
{
$this->{'configure'.ucfirst($this->handler()).'Handler'}($log);
}
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureSingleHandler(Writer $log)
{
$log->useFiles(
$this->app->storagePath().'/logs/laravel.log',
$this->logLevel()
);
}
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureDailyHandler(Writer $log)
{
$log->useDailyFiles(
$this->app->storagePath().'/logs/laravel.log', $this->maxFiles(),
$this->logLevel()
);
}
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureSyslogHandler(Writer $log)
{
$log->useSyslog('laravel', $this->logLevel());
}
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureErrorlogHandler(Writer $log)
{
$log->useErrorLog($this->logLevel());
}
/**
* Get the default log handler.
*
* @return string
*/
protected function handler()
{
if ($this->app->bound('config')) {
return $this->app->make('config')->get('app.log', 'single');
}
return 'single';
}
/**
* Get the log level for the application.
*
* @return string
*/
protected function logLevel()
{
if ($this->app->bound('config')) {
return $this->app->make('config')->get('app.log_level', 'debug');
}
return 'debug';
}
/**
* Get the maximum number of log files for the application.
*
* @return int
*/
protected function maxFiles()
{
if ($this->app->bound('config')) {
return $this->app->make('config')->get('app.log_max_files', 5);
}
return 0;
}
}