-
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
Start consuming np logging config #56480
Start consuming np logging config #56480
Conversation
it breaks legacy-appender compatibility with legacy flags: silent, quiet, verbose
Pinging @elastic/kibana-platform (Team:Platform) |
|
||
expect(getPlatformLogsFromMock(mockConsoleLog)).toMatchInlineSnapshot(` | ||
Array [ | ||
"[xxxx-xx-xxTxx:xx:xx.xxxZ][INFO ][test-file] info", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can stripe timestamps. I decided to keep it to see the difference in the format until we have separate tests for them.
const loggingConfig = { | ||
appenders: { | ||
default: { kind: 'legacy-appender', legacyLoggingConfig: configValue }, | ||
...appenders, | ||
default: { kind: 'legacy-appender', legacyLoggingConfig }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewrites a default appender
this.appenders.set(appenderKey, appenderSchema); |
}, | ||
root: { level: 'info' }, | ||
root: { level: 'info', ...root }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: We allow users to configure roots. Although if a user specifies root.appenders
without defaults
NP logging service won't send logs to the legacy system. I think logging a warning is enough because I don't want to extend user-defined config value, nor enforce default
value presence in root.appenders
(since we will remove this logic in v8). WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging a warning makes sense to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added config validation to prevent server start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, worked as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. My only concern is that during the transition period, when NP logger/appender are configured, there will be formatting differences between messages logged to the 'legacy' console and messages logged with the NP loggers. But that probably can't be avoided.
Yes, I'm about to start working on record format. TBH I don't think it's a bit problem because if you want to use the new config format you kinda expect that output has a different form. |
required during migration period to make sure logs are sent to the LP logging system
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* pass config to the new platform * add default appenders * remove receiveAllAppenders flag it breaks legacy-appender compatibility with legacy flags: silent, quiet, verbose * add integration tests * use console mocks to simplify test setup * update tests * improve names * validate that default appender always presents on root level required during migration period to make sure logs are sent to the LP logging system * do not check condition in the loop * fix integration tests
* pass config to the new platform * add default appenders * remove receiveAllAppenders flag it breaks legacy-appender compatibility with legacy flags: silent, quiet, verbose * add integration tests * use console mocks to simplify test setup * update tests * improve names * validate that default appender always presents on root level required during migration period to make sure logs are sent to the LP logging system * do not check condition in the loop * fix integration tests
* master: (42 commits) Move kuery_autocomplete ⇒ NP (elastic#56607) [ML] Functional tests - stabilize job row and analytics result view assertions (elastic#56595) [Discover] Inline angular directives only used in this plugin (elastic#56119) [Discover] Migrate get_sort.js test from mocha to TypeScript (elastic#56011) [SIEM] Enable flow_target_select_connected unit tests (elastic#55618) Start consuming np logging config (elastic#56480) [SIEM] Add eslint-plugin-react-perf (elastic#55960) Mention changed SAML ACS endpoint URL in breaking changes doc. (elastic#56613) Add `getServerInfo` API to http setup contract (elastic#56636) Updates Monitoring alert Jest snapshots Kibana property config migrations (elastic#55937) Vislib replacement toggle (elastic#56439) [Uptime] Add unit tests for QueryContext time calculation (elastic#56671) [SIEM][Detection Engine] Critical blocker, fixes pre-packaged rule miscounts Upgrade EUI to v18.3.0 (elastic#56228) [Maps] Fix server log (elastic#56679) [SIEM] Fixes FTUE when APM node is present (elastic#56574) [Reporting/FieldFormats] expose `setFieldFormats` and call from ReportingPlugin.start (elastic#56563) Update EMS API urls for production (elastic#56657) Ability to delete alerts even when AAD is out of sync (elastic#56543) ...
Summary
The platform starts handling the new logging config.
Removed
receiveAllAppenders
flag, since it breaks compatibility with the legacy config settings: silent & quiet.Added based integration tests. I will add more to make sure compatibility (when possible) with the legacy log record format.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.[ ] This was checked for cross-browser compatibility, including a check against IE11[ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support[ ] Documentation was added for features that require explanation or tutorials[ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
Dev docs
Provides experimental support of new logging format for new platform plugins. More about logging format: https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.md