We maintain a Laravel 8 POS/restaurant API. Today our "log types" are mapped from route names to ~250 integer constants (e.g. account.close → type id 39). The map is hard to maintain and already has an UNKNOWN fallback when routes are missing.
We are redesigning structured logging (Monolog JSON) and need a taxonomy for each log line.
Two approaches we are considering
A — By code layer
Categories like: controller, service, repository, job, event, integration.
Idea: the field answers "which layer emitted this log?"
B — By domain event nature
Fields like:
type:http|job|command|integrationevent: stable name such asaccount.closed,integration.pay.failedcomponent: class name (debug only), e.g.AccountService
Idea: the primary field answers "what happened in the business/domain?"
We know ECS / OpenTelemetry lean toward event-oriented fields (event.action, etc.), but we want practical trade-offs for a single Laravel monolith, not microservices theory.