1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [structured logging](<https://delaparra-services.nl/knowledge-hub/structured-logging>)

  

Category: Observability 

# structured logging

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is structured logging?

 

structured logging: Logging machine-parseable key/value records (usually JSON) instead of free-form text, so logs can be queried and filtered. Structured logging means writing logs as machine-readable records with named fields, usually JSON, instead of free-form sentences. ` {"level":"error","msg":"payment failed","order_id":4821} ` instead of "Payment failed for order 4821". The difference shows when you search. Finding every failed payment over 100 euros, or every error for one customer, is a simple filter on fields, rather than a fragile text search.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about structured logging

  

### What should you keep in mind with structured logging?

 

Keep message texts constant and put variable details in fields, so similar events can be grouped. Add context such as request ID, user ID and trace ID automatically, for example through a logging context in your framework. Laravel supports this with Monolog formatters and ` Log::withContext() `. As always, keep passwords, tokens and unnecessary personal data out of log fields.

    

### What does an example of structured logging look like?

 

```
{"level":"error","msg":"payment failed","order_id":4821,"latency_ms":250}
```

 

## At a glance

   CategoryObservability Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Observability terms

 

- [SLI](<https://delaparra-services.nl/knowledge-hub/sli>) 
- [SLO](<https://delaparra-services.nl/knowledge-hub/slo>) 
- [span](<https://delaparra-services.nl/knowledge-hub/span>) 
- [trace](<https://delaparra-services.nl/knowledge-hub/trace>) 
- [uptime / availability (nines)](<https://delaparra-services.nl/knowledge-hub/uptime-availability-nines>) 
- [USE method](<https://delaparra-services.nl/knowledge-hub/use-method>)

 

[All terms starting with S](<https://delaparra-services.nl/knowledge-hub#letter-s>)

 

## Skills

 

- ### Sentry PHP SDK

 

Full Sentry SDK setup for PHP. Use when asked to "add Sentry to PHP", "install sentry/sentry", "setup Sentry in PHP", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for PHP applications. Supports plain PHP, Laravel, and Symfony.

 [View skill](<https://delaparra-services.nl/skills/sentry-php-sdk>) [Download zip](<https://delaparra-services.nl/skills/sentry-php-sdk/download>) 
- ### Error Handling Patterns

 

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

 [View skill](<https://delaparra-services.nl/skills/error-handling-patterns>) [Download zip](<https://delaparra-services.nl/skills/error-handling-patterns/download>) 
- ### AWS CloudWatch Investigation Skill

 

\>

 [View skill](<https://delaparra-services.nl/skills/aws-cloudwatch-investigation>) [Download zip](<https://delaparra-services.nl/skills/aws-cloudwatch-investigation/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/structured-logging/skills.zip>)

 

## Manuals

 

- [Logging and monitoring for your app](<https://delaparra-services.nl/manuals/logging-en-monitoring>) 
- [Understanding common error messages](<https://delaparra-services.nl/manuals/foutmeldingen-begrijpen>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet. 
- [AI code review](<https://delaparra-services.nl/services#service-05>)

When you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/structured-logging)
