skill-php-logging

Implement structured JSON logging with request-scoped context for PHP applications.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/claudioborja/biblioteca --skill skill-php-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-php-logging
Source: https://github.com/claudioborja/biblioteca/tree/main/.agents/skills/skill-php-logging
Command: npx skills add https://github.com/claudioborja/biblioteca --skill skill-php-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The PHP Logging Skill provides structured, production-ready logging with context, error handling, and performance observability for PHP applications.

Core Features & Use Cases

  • Structured JSON logs for automated parsing and monitoring
  • Request-scoped context (request ID, user ID, IP) across HTTP requests and CLI
  • Slow-query detection and logging; central exception handling; log rotation; audit logging for domain events

Quick Start

Configure the bootstrap to enable the logger and exception handler on startup, then run your PHP app to begin emitting structured logs.

Frequently Asked Questions about skill-php-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured PHP logging for production debugging?

Structured PHP logging for production debugging is implemented by configuring a bootstrap to enable a logger and exception handler on startup, emitting context-rich JSON logs across HTTP requests and CLI runtime.

How does request-scoped context work in PHP application logging?

Request-scoped context in PHP logging works by attaching identifiers like request ID, user ID, and IP address to logs across HTTP requests and CLI, ensuring traceable audit trails for domain events and user actions.

Can I detect slow database queries using PHP logging?

You can detect slow database queries in PHP by enabling slow-query detection and logging with a configurable threshold, capturing performance observability data directly within your structured log output.

Does this PHP logging framework support PSR-3 log levels and log rotation?

This PHP logging framework supports PSR-3 compatible log levels, structured JSON or text formatting, and includes log rotation to manage log file sizes in production-grade applications.

What is the best way to handle exceptions and generate audit trails in PHP?

The best way to handle exceptions and generate audit trails in PHP is to enable central exception handling and audit logging within a unified framework, capturing domain events alongside request-scoped context.

Why are my PHP application logs not parsing correctly in monitoring systems?

PHP application logs may not parse correctly if they lack a unified format. Using structured JSON logging enforces consistent formatting across runtime and HTTP requests, enabling automated parsing and monitoring.