Configure logging
You do not need to create a log source to send logs from the AppSignal for PHP integration. An “application” log source will be created automatically. The AppSignal for PHP package uses OpenTelemetry’s logging capabilities to send logs to AppSignal.Laravel
If you’re using the Laravel framework, the AppSignal for PHP package automatically sends your logs to AppSignal. You do not need to configure Monolog directly.Symfony
If you’re using the Symfony framework, the easiest way to send logs to AppSignal is by using theMonologBundle.
Install the Monolog auto-instrumentation package.
Shell
'appsignal.monolog.handler' that uses the Appsignal\Integrations\Monolog\Handler class.
config/services.yaml
appsignal.monolog.handler to the Monolog handler stack.
config/packages/monolog.yaml
Monolog
Monolog is the most popular logging library for PHP. You can use Monolog directly to send logs to AppSignal. Install the Monolog auto-instrumentation package.Shell
Appsignal\Integrations\Monolog\Handler to Monolog’s handler stack.
PHP
Stand-alone usage
You can also send logs with the stand-alone logger using thelog helper method from the Appsignal base class. This method doesn’t require configuration.
PHP
PHP
Sending logs
Monolog
Using Monolog, you can define the severity level of your logs:PHP
PHP
Stand-alone logger
Using the stand-alone logger, you can define the severity level of your logs:PHP
PHP
Filtering logs
You can query and filter on message contents and attribute values from within the Log Management tool. Once configured, the desired attributes will be sent to AppSignal as log tags, and be queryable in the AppSignal logging interface.Structured logging
AppSignal supports structured logging out of the box. You can send structured data as log attributes:PHP
You can also configure AppSignal for PHP to ignore specific log lines using the
ignore_logs option. See our Ignore Logs guide to learn more.