本文整理汇总了PHP中Illuminate\Support\Facades\Log::getMonolog方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::getMonolog方法的具体用法?PHP Log::getMonolog怎么用?PHP Log::getMonolog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Log
的用法示例。
在下文中一共展示了Log::getMonolog方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* LogService constructor.
*
* @param $monolog
*/
public function __construct()
{
$this->monolog = Log::getMonolog();
$this->path = storage_path() . '/logs/';
$this->type = Logger::INFO;
$this->file = "laravel.log";
}
示例2: boot
/**
* Send logs from the given level to Pushbullet.
*
* @return void
*/
public function boot()
{
parent::boot();
if (in_array(config('app.env'), (array) config('services.monobullet.env', config('app.env')))) {
$monolog = Log::getMonolog();
$monolog->pushHandler(new PushbulletHandler(config('services.monobullet.token'), config('services.monobullet.recipients'), config('services.monobullet.level', Logger::INFO), config('services.monobullet.propagate', true)));
}
}
示例3: getEnvironmentSetUp
/**
* Define environment setup.
*
* @param Illuminate\Foundation\Application $app
* @return void
*/
protected function getEnvironmentSetUp($app)
{
// reset base path to point to our package's src directory
$app['path.base'] = __DIR__ . '/../../';
$app['config']->set('app.debug', false);
// Here we disable any log output to the console, which makes reading any test
// errors/information easier to read and understand during test runs.
$monolog = Log::getMonolog();
$monolog->pushHandler(new NullHandler());
// Necessary for future checks
Config::set('shift.languages', ['en_GB' => 'English (Great Britain)']);
}
示例4: bootWhenLocal
protected function bootWhenLocal()
{
//开发环境
if (!$this->app->isLocal()) {
return;
}
//日志
$logger = Log::getMonolog();
$logger->pushHandler(new BrowserConsoleHandler());
//DB事件
DB::listen(function ($query) {
Log::info('sql :' . $query->sql, ['binding' => $query->bindings, 'time' => $query->time]);
});
}
示例5: boot
/**
* Boot the service provider.
*
* @return void
*
* @author Wuhsien Yu <wuhsienyu@gmail.com>
*
* @since 2016/03/10
*/
public function boot()
{
$monolog = Log::getMonolog();
$LogLevel = Logger::toMonologLevel(self::getLevel());
foreach (Logger::getLevels() as $level) {
if ($LogLevel <= $level) {
$logHandler = new StreamHandler(self::getPath($level), $level, false);
$logHandler->setFormatter(self::getFormat());
} else {
$logHandler = new NullHandler($level);
}
$monolog->pushHandler($logHandler);
}
$this->publishes([__DIR__ . '/../config/log.php' => config_path('log.php')]);
}
示例6: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->singleton('tevo', function () {
// Setup Logger
$log = Log::getMonolog();
$log->pushHandler(new RotatingFileHandler(storage_path('logs/tevo-api-client-log.txt'), 0, constant('\\Monolog\\Logger::' . env('TEVO_API_CLIENT_LOG_LEVEL', 'INFO'))));
if (env('TEVO_API_CLIENT_LOG_LEVEL') === 'DEBUG') {
$subscriberLogLevel = 'DEBUG';
} else {
$subscriberLogLevel = 'CLF';
}
$logSubscriber = new LogSubscriber($log, constant('\\GuzzleHttp\\Subscriber\\Log\\Formatter::' . $subscriberLogLevel));
$apiClient = new Client(config('ticketevolution'));
$apiClient->getEmitter()->attach($logSubscriber);
return $apiClient;
});
$this->app->alias('Tevo', self::class);
}
示例7: getLogKayitlari
public function getLogKayitlari()
{
$monolog = Log::getMonolog();
return view('yonetim.logkayitlari', compact('monolog'));
}
示例8: getLogger
/**
* @return LoggerInterface
*/
public function getLogger()
{
return $this->logger ?: ($this->logger = Log::getMonolog());
}
示例9: getLogPlugin
/**
* Get the log plugin.
*
* @return LogPlugin
*/
public static function getLogPlugin()
{
$adapter = new MonologLogAdapter(Log::getMonolog());
$format = "[{ts}] \"{method} {resource} {protocol}/{version}\" {code} {phrase} time:{total_time} kinveyRID:{res_header_x-kinvey-request-id} request:{req_body}";
$formatter = new MessageFormatter($format);
return new LogPlugin($adapter, $formatter);
}
示例10: __construct
/**
* Constructor
*
* @param Application $app
*/
public function __construct($app = null)
{
$this->app = $app;
$this->initializeLumberjack(Log::getMonolog());
$this->boot();
}