taildev/php
For Laravel integration, see taildev/laravel
Docs
See full documentation at tail.dev/documentation/php/get-started
Quickstart
Install the taildev/php package using Composer
composer require taildev/php
Make sure that the composer autoloader is being required somewhere in your project:
require __DIR__ . '/vendor/autoload.php';
APM
Initialize APM with your auth token and service name (any name you'd like to identify this service)
use Tail\Apm;
Apm::init('secret_token', 'service-name');
Apm::startRequest();
register_shutdown_function(function () {
Apm::finish();
});
Alternatively you can use startJob($name) for background jobs, CLI commands, etc. or startCustom($name)
To add spans to the transaction
$span = Apm::newDatabaseSpan('fetch-config');
// ... code fetching config
$span->finish();
Span "types" are used to categorize operations.
Apm::newSpan(string $type, string $name); // to use your own custom type
Apm::newCustomSpan($name); // type = "custom"
Apm::newDatabaseSpan($name); // type = "database"
Apm::newCacheSpan($name); // type = "cache"
Apm::newFilesystemSpan($name); // type = "filesystem"
Logs
Initialize logging with your auth token. You may optionally provide a service name and environment if you wish
use Tail\Log;
Log::init('secret_token', 'optional-service-name', 'optional-environment');
You can now use the logger anywhere to log a message
use Tail\Log;
Log::get()->debug('my debug message');
Log::get()->alert('something went wrong', ['custom_tag' => 'some-value']);
More
For full documentation see tail.dev/documentation/php/get-started
Related Packages
Microsoft Azure Application Insights for Laravel 10+ - A fully maintained packag...
Automatic error reporting and log management for Laravel applications
Observability toolkit for Laravel applications - Monitor HTTP requests, outbound...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.6.3 | MIT | |||
| v0.6.2 | MIT | |||
| v0.6.1 | MIT | |||
| v0.6.0 | MIT | |||
| v0.5.0 | MIT | |||
| v0.4.5 | MIT | |||
| v0.4.4 | MIT | |||
| v0.4.3 | MIT | |||
| v0.4.2 | 5.*| | MIT | ||
| v0.4.1 | 5.*| | MIT | ||
| v0.4.0 | 5.*| | MIT | ||
| v0.3.3 | 5.*| | MIT | ||
| v0.3.2 | 5.*| | MIT | ||
| v0.3.1 | 5.*| | MIT | ||
| v0.3.0 | 5.*| | MIT | ||
| v0.2.2 | MIT | |||
| v0.2.1 | MIT | |||
| v0.1.10 | MIT | |||
| v0.1.9 | MIT | |||
| v0.1.8 | MIT | |||
| v0.1.7 | MIT | |||
| v0.1.6 | MIT | |||
| v0.1.5 | MIT | |||
| v0.1.4 | MIT | |||
| v0.1.3 | ^7.2 | MIT | ||
| v0.1.2 | ^7.2 | MIT | ||
| v0.1.1 | ^7.2 | MIT | ||
| v0.1.0 | ^7.2 | MIT |