Open
Description
Question Description
Hi there, how can i using gofiber and write log, data sample:
{
"@timestamp":"2025-05-27T15:23:10.123Z",
"level":"ERROR",
"service":"order-service",
"env":"production",
"host":"order-5fd7c8bdc9-abc12",
"pid":42,
"request_id":"a1b2c3d4e5f6",
"trace_id":"abcd1234efgh5678",
"span_id":"1234abcd",
"http.method":"POST",
"http.path":"/api/orders",
"http.status":500,
"http.latency":"150ms",
"user.id":"u-98765",
"operation":"CreateOrder",
"entity.id":"o-123456",
"error.message":"database timeout [repo.go:45]",
"error.code":"400",
"db.statement":"INSERT INTO orders ...",
"db.duration": "145ms"
}
i need Log file name and line in handler directory or db (gorm) query failed
Project structure: router -> handler -> repo
Thanks!
Code Snippet (optional)
Checklist:
- I agree to follow Fiber's Code of Conduct.
- I have checked for existing issues that describe my questions prior to opening this one.
- I understand that improperly formatted questions may be closed without explanation.