Field Manual PHP / Laravel reference
← Engineering

Logging

Logs explain execution and failure in operational terms.

What it is

Logs explain execution and failure in operational terms.

When to use it

Use structured context and correlation IDs.

Syntax

event + actor ID + entity ID + request ID + safe reason

Example

Log::info("transfer.settled", [
    "transfer_id" => $transfer->id,
    "actor_id" => $actor->id,
    "request_id" => $requestId,
]);

Common mistakes

Logging everything increases cost and sensitive-data exposure; avoid ambiguous success messages.

Related topics

LoggingLogging