-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[browser] Logging Service #33796
Comments
Pinging @elastic/kibana-platform |
@eliperelman Removed you since we're not working on this yet. |
Quick thoughts:
The API at least should be consistent, yes
|
Re-open, as we still need it. |
imho we should start this as soon as possible. Having an initial implementation that just fallback to |
I'm highly in favor of this. There is a standard of using the toasts service to show an error when something goes wrong, but this often does not show low-level details about the error. the addError method of the service accepts an Error object parameter, but this does not work well if the actual error object is a custom class that extends Error. In addition to having the error toasts in the UI, it would be helpful to also log the error object in a way that can be explored better. I think we should try to build that habit. |
@tsullivan You might want to check out #104235 for some thoughts I've had on this subject. There are links to related issues which you might also find relevant. |
@elastic/kibana-core Here (#133546) is another use case for the client-side logger. We need this to help other teams find places where they use deprecated functions or wrong parameters. Currently, we have a wrapper around the built-in console, but it would be handy to have a fully functional logger service with namespaces/scopes and with support of the logging options from While discovering a solution, I found a couple of places in Kibana doing the same thing as we ended up implementing. My guess is that the longer we don't have a default implementation, the more technical debt we get. |
My opinion didn't change since last year:
@lukeelmers should we prioritize this one? |
FWIW, here's a very basic implementation we already had to implement in a core service: https://github.com/elastic/kibana/blob/main/packages/core/analytics/core-analytics-browser-internal/src/logger.ts |
I think it's worth trying to prioritize, even if we are only starting with a simple wrapper around |
Discussed as a team today, and agreed we will keep the scope of this issue to the following:
|
#144107 introduces the base implementation as described in this comment and has been merged. #144276 has been created as follow-up for the full featured implementation. |
#144276 is the main issue to keep track of the work for the browser-side logging system now. I will close this one. |
A full-featured logger in frontend code would go a long way to support debugging issues for customer support as well as any audit logging feature that we may consider in the future.
Desired features:
We should be able to largely reuse the server-side implementation of a log4j 2-like logging system that makes use of layouts and appenders to format log outputs. Indeed, the actual implementation of this system on the frontend could be as simple as a in-memory buffer that flushes these logs to the backend, delegating the appender and layout logic to the existing backend logging service. There may need to be some exceptions for this, to log to the web console, for instance.
Subtasks:
The text was updated successfully, but these errors were encountered: