Error Logger
Used to save unhandled errors in error log. Hitrix use recovery
function to handle those errors. If you setup Slack service you also going to receive notifications in your slack
Register the service into your main.go
file:
registry.ServiceProviderErrorLogger()
1
Access the service:
service.DI().ErrorLogger()
1
It can be used to save custom errors as well:
errorLoggerService := ioc.GetErrorLoggerService()
errorLoggerService.LogErrorWithRequest(c, err) //if you provide context we will save request body as well
errorLoggerService.LogError(err)
1
2
3
4
2
3
4