-
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
[Meta] Logging in the new platform #12469
Comments
absolutely! we should minimize our ask from users to configure to configure/define/run additional services/processes aside of our products to make them production ready. Simply align with how ES's logic here (implementation wise, I believe log4j is responsible for the rotation in ES)
align with ES here. we should at least have console & file. As for shipping the logs elsewhere (e.g. ES) we need to align it across the stack - we can potentially use file beat to ship the logs and if we do this we'll do it in both ES and Kibana (and LS). as far as alignment is concerned... it'd be great to also align the message formatting across the products... they should all feel the same. |
++ great input, @uboness |
Hi, I have a customer who wants the non-JSON output to have date as well as time. Currently we have date in the JSON output only. Will the new logging platform support it? |
Hi @kiju98, Yes, default logging format for the new platform includes full date (like in Elasticsearch), e.g.:
But since new logging format is a breaking change we aren't sure yet when we'll be able to switch to it. |
Closing, as we're now tracking the rest in separate issues. |
In the new platform we want to make some improvement to logging in Kibana.
First of, we don't want it coupled to the
server
object like we do today, but to be a separate core "service/feature".We also want to explore how the logger is configured. Today we have
silent
,quite
,verbose
, but I think we should explore something that looks more similar to the ES approach where you specify the log level. (In ES you can also specify log-level per context/namespace, which could be interesting to explore. This might solve thedowngrade
functionality we have today too.)It's essential that the logger has no global state. We want no parts of core Kibana to have global state.
We want namespaced loggers, e.g.
The logger needs to be (re-)configurable at runtime. And when the config changes I think we shouldn't have to
.get
a new logger. It's easy to build an api that just changes the logging config internally but still keeps the same ref externally. (I think going the observable route here over-complicates the logging api.)How do we handle the logger before we've loaded the Kibana config? Do we have a separate config file like ES has, or do we keep logs in memory and then when we've loaded the config and applied the settings we replay the logs? (If loading config fails we can log to stderr or something like that?)
In my PoC I explored having a test helper that collects all logs, so you can snapshot test the log output from running some functionality. (Look at
logger
inHttpService.test.ts
to see how it's used, and an example snapshot). I think this is a very interesting feature in certain locations where the log output itself is part of a feature, like deprecations etc.Open questions:
(I half-way built a PoC that explores some of this in https://github.com/elastic/kibana/tree/new-platform/platform/logger that can be used for further exploration)
Tasks:
Logging should support JSON output Logging should support JSON output #12941Improve the way we handle defaultroot
logger Improve the way we handle defaultroot
logger #13098Replace::
logger context separator with more commonly used.
Replace::
logger context separator with more commonly used.
#13105The text was updated successfully, but these errors were encountered: