{
    "url": "https://delaparra-services.nl/knowledge-hub/structured-logging",
    "locale": "en",
    "title": "structured logging: Knowledge hub | DeLaParra Services",
    "description": "Logging machine-parseable key/value records (usually JSON) instead of free-form text, so logs can be queried and filtered.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/structured-logging",
        "nl": "https://delaparra-services.nl/nl/kennisbank/structured-logging"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/structured-logging.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/structured-logging.md",
        "json": "https://delaparra-services.nl/knowledge-hub/structured-logging.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/structured-logging.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/structured-logging.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/structured-logging.csv",
            "encodingFormat": "text/csv",
            "name": "structured-logging.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/structured-logging.json",
            "encodingFormat": "application/json",
            "name": "structured-logging.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/structured-logging.md",
            "encodingFormat": "text/markdown",
            "name": "structured-logging.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/structured-logging.pdf",
            "encodingFormat": "application/pdf",
            "name": "structured-logging.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/structured-logging.zip",
            "encodingFormat": "application/zip",
            "name": "structured-logging.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/structured-logging/skills.zip",
            "encodingFormat": "application/zip",
            "name": "structured-logging-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [structured logging](<https://delaparra-services.nl/knowledge-hub/structured-logging>)\n\n  \n\nCategory: Observability \n\n# structured logging\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is structured logging?\n\n \n\nstructured 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.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about structured logging\n\n  \n\n### What should you keep in mind with structured logging?\n\n \n\nKeep 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.\n\n    \n\n### What does an example of structured logging look like?\n\n \n\n```\n{\"level\":\"error\",\"msg\":\"payment failed\",\"order_id\":4821,\"latency_ms\":250}\n```\n\n \n\n## At a glance\n\n   CategoryObservability Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More Observability terms\n\n \n\n- [SLI](<https://delaparra-services.nl/knowledge-hub/sli>) \n- [SLO](<https://delaparra-services.nl/knowledge-hub/slo>) \n- [span](<https://delaparra-services.nl/knowledge-hub/span>) \n- [trace](<https://delaparra-services.nl/knowledge-hub/trace>) \n- [uptime / availability (nines)](<https://delaparra-services.nl/knowledge-hub/uptime-availability-nines>) \n- [USE method](<https://delaparra-services.nl/knowledge-hub/use-method>)\n\n \n\n[All terms starting with S](<https://delaparra-services.nl/knowledge-hub#letter-s>)\n\n \n\n## Skills\n\n \n\n- ### Sentry PHP SDK\n\n \n\nFull 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.\n\n [View skill](<https://delaparra-services.nl/skills/sentry-php-sdk>) [Download zip](<https://delaparra-services.nl/skills/sentry-php-sdk/download>) \n- ### Error Handling Patterns\n\n \n\nMaster 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.\n\n [View skill](<https://delaparra-services.nl/skills/error-handling-patterns>) [Download zip](<https://delaparra-services.nl/skills/error-handling-patterns/download>) \n- ### AWS CloudWatch Investigation Skill\n\n \n\n\\>\n\n [View skill](<https://delaparra-services.nl/skills/aws-cloudwatch-investigation>) [Download zip](<https://delaparra-services.nl/skills/aws-cloudwatch-investigation/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/structured-logging/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [Logging and monitoring for your app](<https://delaparra-services.nl/manuals/logging-en-monitoring>) \n- [Understanding common error messages](<https://delaparra-services.nl/manuals/foutmeldingen-begrijpen>)\n\n \n\n## Related services\n\n \n\n- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)\n\nPerhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet. \n- [AI code review](<https://delaparra-services.nl/services#service-05>)\n\nWhen 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.\n\n \n\n## Need any help?\n\n \n\nStuck 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.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/structured-logging)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/structured-logging",
                "name": "structured logging: Knowledge hub | DeLaParra Services",
                "description": "Logging machine-parseable key/value records (usually JSON) instead of free-form text, so logs can be queried and filtered.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#term",
                    "name": "structured logging",
                    "description": "Logging machine-parseable key/value records (usually JSON) instead of free-form text, so logs can be queried and filtered.",
                    "termCode": "structured-logging",
                    "url": "https://delaparra-services.nl/knowledge-hub/structured-logging",
                    "inLanguage": "en",
                    "keywords": "Observability",
                    "dateModified": "2026-11-25T17:46:30+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is structured logging?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "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."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with structured logging?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "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."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What does an example of structured logging look like?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "{\"level\":\"error\",\"msg\":\"payment failed\",\"order_id\":4821,\"latency_ms\":250}"
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/sentry-php-sdk#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/error-handling-patterns#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/aws-cloudwatch-investigation#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/logging-en-monitoring#article"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/foutmeldingen-begrijpen#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "structured logging"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#dataset",
                "name": "structured logging",
                "description": "Logging machine-parseable key/value records (usually JSON) instead of free-form text, so logs can be queried and filtered.",
                "url": "https://delaparra-services.nl/knowledge-hub/structured-logging",
                "identifier": "https://delaparra-services.nl/knowledge-hub/structured-logging#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/structured-logging#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "Observability",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:30+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "structured-logging.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/structured-logging.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:30+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "structured-logging.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/structured-logging.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:30+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "structured-logging.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/structured-logging.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:30+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "structured-logging.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/structured-logging.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:30+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "structured-logging.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/structured-logging.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:30+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "structured-logging-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/structured-logging/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:30+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}