To use `trigger_error` instead of `error_log`
Is your feature request related to a problem?
When the logger is not set to LogHolder but a generic error handler is set in application that is set by set_error_handler, error handler is not invoked because error_log function does not trigger this.
Describe the solution you'd like
To use trigger_error instead of error_log in ErrorLogWriter to allow error handler to handle logging.
What would you think about a change like this?
I'm not sure that we want that as default behaviour, wouldn't this mean runtime opentelemetry exceptions would/could break the observed application? https://opentelemetry.io/docs/specs/otel/error-handling/#basic-error-handling-principles
Yes, depending on the error handler implementation the log might turn into unhandled exception and the application could break.
What would you think about adding a "trigger_error" option to LogWriterFactory so we use it only if it is set intentionally?
I am now moving to psr3 logger for my case, but almost all containerized applications need some kind of special formatting for logging and my assumption was that I would be able to handle all logging in the error handler.
What would you think about adding a "trigger_error" option
Adding a new option seems safe enough, if we think there's a use-case for it. Would you like to work on it?