> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Symfony

[Symfony](https://symfony.com) is een PHP-framework met hoge prestaties voor webontwikkeling.

De functies voor tracing en metrics van AppSignal werken out of the box met het Symfony-framework.

## Logging

U kunt uw logger configureren om logs naar AppSignal te sturen.

### Monolog

Als u `Monolog` gebruikt, kunt u een AppSignal-handler toevoegen aan de [Monolog handler-stack](https://symfony.com/doc/current/logging.html#handlers-writing-logs-to-different-locations) die logs naar AppSignal stuurt.

```yml title="config/packages/monolog.yaml" theme={null}
monolog:
  handlers:
    # other handlers

    appsignal:
      type: service
      id: appsignal.monolog.handler
      channels: ["app", "event"] # configure which channels to send to AppSignal
```

Voeg daarna een service-definitie toe voor `'appsignal.monolog.handler'` die de klasse `Appsignal\Integrations\Monolog\Handler` gebruikt.

```yml title="config/services.yaml" theme={null}
services:
  # ... other services

  appsignal.monolog.handler:
    class: Appsignal\Integrations\Monolog\Handler
    factory: ['Appsignal\Integrations\Monolog\Handler', "withLevel"]
    arguments: ["info"] # configure log level that will reach AppSignal
```

### Stand-alone logger

U kunt ook de stand-alone logger gebruiken en logs naar AppSignal sturen met de helper-methode `Appsignal::log`. Deze methode vereist geen configuratie en stuurt logs uitsluitend naar AppSignal.

```php PHP theme={null}
use Appsignal\Appsignal;
use Appsignal\Severity;

Appsignal::log(
	message: 'A test log',
	severity: Severity::INFO,
	attributes: ['region' => 'eu'],
	loggerName: 'my-custom-logger',
);
```
