This package is abandoned for a more reliable, standardized and tested package. Please refer to khalyomede/syslog as an alternative as this package will now loose its support.
Let you log in your papertrail log server
- You will need to activate the
php_sockets
extension by uncommenting the line in thephp.ini
file. - You will need to use Composer for this package.
Execute composer require port-adhoc/papertrail
from the prompt command in your project folder.
require( __DIR__ . '/vendor/autoload.php' );
use PortAdhoc\Papertrail;
Papertrail::host('example.papertrailapp.com')
->port(123456)
->facility(99)
->program('cron')
->component('spam-cleaning')
->message('hello world')
->severity( Papertrail::SEVERITY_DEBUG )
->send();
Refer to the Severity levels constants list for more severity levels.
require( __DIR__ . '/vendor/autoload.php' );
use PortAdhoc\Papertrail;
Papertrail::host('example.papertrailapp.com')
->port(123456)
->facility(99)
->program('cron')
->component('spam-cleaning');
// a few moments later
Papertrail::message('fetching table done')
->severity( Papertrail::SEVERITY_DEBUG )
->send();
// an eternity later
Papertrail::message('cleaning table done')
->severity( Papertrail::SEVERITY_DEBUG )
->send();
Refer to the Severity levels constants list for more severity levels.
If you ran into a similar error :
It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Please use date_default_timezone_set()
to globally set your timezone.
Papertrail::SEVERITY_EMERGENCY
Papertrail::SEVERITY_ALERT
Papertrail::SEVERITY_CRITICAL
Papertrail::SEVERITY_ERROR
Papertrail::SEVERITY_WARNING
Papertrail::SEVERITY_NOTICE
Papertrail::SEVERITY_INFORMATIONAL
Papertrail::SEVERITY_DEBUG