---
title: "Log configuration for Laravel multi-line backtrace logs in Datadog"
date: 2021-04-13
updated: 2026-09-26
canonical: https://michaelshadle.com/2021/04/12/log-configuration-for-laravel-multi-line-backtrace-logs-in-datadog
---

# Log configuration for Laravel multi-line backtrace logs in Datadog

Thanks to [this link](https://zenn.dev/m_norii/articles/dbc9f6ce975f57) I was able to find this snippet to help quick. I wanted to share this with the world, since it was the only result Google had for this.

```
log_processing_rules:
   - type: multi_line
     name: new_log_start_with_date
     pattern: \[\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])
```

Here is my full YAML file, for example (in a custom config directory. filename: /etc/datadog-agent/conf.d/custom.d/conf.yaml) - based off a Forge created server. I used wildcards to ensure that it was universally available to all hosts and sites.

```
logs:
  - type: file
    path: /home/forge/*/storage/logs/*.log
    service: laravel
    source: laravel
    log_processing_rules:
       - type: multi_line
         name: new_log_start_with_date
         pattern: \[\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])
```
