jeremyharris/psr3-papertrail
Composer 安装命令:
composer require jeremyharris/psr3-papertrail
包简介
PSR-3 logger for Papertrail
关键字:
README 文档
README
PSR-3 Papertrail Logger
This is a PSR-3 compatible logger that logs to Papertrail.
Installation
composer require jeremyharris/psr3-papertrail
To log to Papertrail, you must define the following constants with your Papertrail credentials:
PAPERTRAIL_HOST: Your Papertrail hostPAPERTRAIL_PORT: Your Papertrail port
Usage
define('PAPERTRAIL_HOST', 'example.papertrailapp.com'); define('PAPERTRAIL_PORT', 1234); $logger = new \JeremyHarris\Papertrail\Logger; $logger->log('error', 'An error occured');
For more information about PSR-3 logging, visit the PSR-3 recommendation.
This package contains the \Psr\Log\LogLevel class for friendly log level
constants.
Note: Logs are transported over UDP and are therefore fast but fail silently.
Context Options
While no context options are required, you can pass a program and hostname to manually define them.
string $program: Program to use. Uses'logger'by default.string $hostname: Hostname to use. Usesgethostname()by defaultstring $facility: Facility to use. Uses local0 (16) by default. See RFC 3164 for details
This code was mostly taken from the Papertrail docs and this gist.
统计信息
- 总下载量: 3.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-03