Skip to main content
This documentation outlines how to configure logging with the AppSignal for PHP package.

Configure logging

🔐 Do not send Personal Identifiable Information (PII) to AppSignal. Filter PII (e.g., names, emails) from logs and use an ID, hash, or pseudonymized identifier instead.

For HIPAA-covered entities, more information about signing a Business Associate Agreement (BAA) can be found in our Business Add-Ons documentation.
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 the MonologBundle. Install the Monolog auto-instrumentation package.
Shell
Add a service definition for 'appsignal.monolog.handler' that uses the Appsignal\Integrations\Monolog\Handler class.
config/services.yaml
Add 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
Then add Appsignal\Integrations\Monolog\Handler to Monolog’s handler stack.
PHP

Stand-alone usage

You can also send logs with the stand-alone logger using the log helper method from the Appsignal base class. This method doesn’t require configuration.
PHP
Configure Monolog with the OpenTelemetry handler to send logs to AppSignal:
PHP

Sending logs

Monolog

Using Monolog, you can define the severity level of your logs:
PHP
You can define custom attributes to send log information that can be used when filtering and querying logs:
PHP

Stand-alone logger

Using the stand-alone logger, you can define the severity level of your logs:
PHP
You can define custom attributes to send log information that can be used when filtering and querying logs:
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.

Need help?

After configuring your PHP application to send logs, logs should appear in AppSignal. If you are unsure about this step or AppSignal is not receiving any logs, you can always reach out for assistance. We’ll help get you back on track!