Skip to content
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

[8.0] Remove legacy logging #112305

Merged
merged 44 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eb6d618
remove kbn-legacy-logging package
pgayvallet Sep 15, 2021
0771036
remove legacy service
pgayvallet Sep 15, 2021
7bae5e5
remove legacy appender
pgayvallet Sep 15, 2021
7b8aeb5
remove LegacyObjectToConfigAdapter
pgayvallet Sep 15, 2021
3e5c71a
gix types
pgayvallet Sep 16, 2021
1ca0080
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 16, 2021
2aa840b
remove @hapi/good / @hapi/good-squeeze / @hapi/podium
pgayvallet Sep 16, 2021
0d8b958
remove `default` appender validation for `root` logger
pgayvallet Sep 16, 2021
6b25dde
remove old config key from kibana-docker
pgayvallet Sep 16, 2021
cf931a4
fix FTR config
pgayvallet Sep 16, 2021
a1a1568
fix dev server
pgayvallet Sep 16, 2021
25460af
remove reference from readme
pgayvallet Sep 16, 2021
32bbc99
fix unit test
pgayvallet Sep 16, 2021
b6f7cfd
clean CLI args and remove quiet option
pgayvallet Sep 16, 2021
5d2c1cc
fix type
pgayvallet Sep 16, 2021
f13bc1f
fix status test config
pgayvallet Sep 16, 2021
4d7927f
remove from test config
pgayvallet Sep 16, 2021
afabe9e
fix snapshot
pgayvallet Sep 16, 2021
d7cc6e7
use another regexp
pgayvallet Sep 16, 2021
db4edaa
update generated doc
pgayvallet Sep 16, 2021
fb4ff9e
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 17, 2021
e4aac52
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
Sep 20, 2021
f1a5814
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 21, 2021
2fe5a24
fix createRootWithSettings
pgayvallet Sep 21, 2021
1b7ff38
fix some integration tests
pgayvallet Sep 21, 2021
8c0d873
another IT fix
pgayvallet Sep 21, 2021
e1d6174
yet another IT fix
pgayvallet Sep 21, 2021
78d5560
(will be reverted) add assertion for CI failure
pgayvallet Sep 21, 2021
11131d4
Revert "(will be reverted) add assertion for CI failure"
pgayvallet Sep 21, 2021
2da87f6
switch back to json layout for test
pgayvallet Sep 21, 2021
14be47f
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 22, 2021
abd2e6f
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 23, 2021
7c978a6
remove legacy logging config deprecations
pgayvallet Sep 23, 2021
c09776d
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 24, 2021
67ce208
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 27, 2021
b33664b
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 28, 2021
2188399
address some review comments
pgayvallet Sep 28, 2021
48efa70
update documentation
pgayvallet Sep 28, 2021
3e34e23
update kibana.yml config examples
pgayvallet Sep 28, 2021
f41b60b
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 28, 2021
234f4fb
add config example for `metrics.ops`
pgayvallet Sep 28, 2021
4957cd0
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Sep 30, 2021
d97156c
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Oct 4, 2021
bd20385
Merge remote-tracking branch 'upstream/master' into kbn-50660-remove-…
pgayvallet Oct 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@
/packages/kbn-std/ @elastic/kibana-core
/packages/kbn-config/ @elastic/kibana-core
/packages/kbn-logging/ @elastic/kibana-core
/packages/kbn-legacy-logging/ @elastic/kibana-core
/packages/kbn-crypto/ @elastic/kibana-core
/packages/kbn-http-tools/ @elastic/kibana-core
/src/plugins/saved_objects_management/ @elastic/kibana-core
Expand Down
30 changes: 19 additions & 11 deletions config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,32 @@
# Time in milliseconds for Elasticsearch to wait for responses from shards. Set to 0 to disable.
#elasticsearch.shardTimeout: 30000

# Logs queries sent to Elasticsearch. Requires logging.verbose set to true.
#elasticsearch.logQueries: false

# Specifies the path where Kibana creates the process ID file.
#pid.file: /run/kibana/kibana.pid

# Set the value of this setting to off to suppress all logging output, or to debug to log everything.
# logging.root.level: debug

# Enables you to specify a file where Kibana stores log output.
#logging.dest: stdout
# logging.appenders.default:
# type: file
# fileName: /var/logs/kibana.log


# Set the value of this setting to true to suppress all logging output.
#logging.silent: false
# Logs queries sent to Elasticsearch.
# logging.loggers:
# - name: elasticsearch.queries
# level: debug

# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false
# Logs http responses.
# logging.loggers:
pgayvallet marked this conversation as resolved.
Show resolved Hide resolved
# - name: http.server.response
# level: debug

# Set the value of this setting to true to log all events, including system usage information
# and all requests.
#logging.verbose: false
# Logs system usage information.
# logging.loggers:
# - name: metrics.ops
# level: debug

# Set the interval in milliseconds to sample system and process performance
# metrics. Minimum is 100ms. Defaults to 5000.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,5 @@ you can override the flags with:

|--verbose| --logging.root.level=debug --logging.root.appenders[0]=default --logging.root.appenders[1]=custom | --verbose

|--quiet| --logging.root.level=error --logging.root.appenders[0]=default --logging.root.appenders[1]=custom | not supported

|--silent| --logging.root.level=off | --silent
|===

NOTE: To preserve backwards compatibility, you are required to pass the root `default` appender until the legacy logging system is removed in `v8.0`.
1 change: 0 additions & 1 deletion docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ yarn kbn watch
- @kbn/i18n
- @kbn/interpreter
- @kbn/io-ts-utils
- @kbn/legacy-logging
- @kbn/logging
- @kbn/mapbox-gl
- @kbn/monaco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<b>Signature:</b>

```typescript
export declare type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | LegacyAppenderConfig | RewriteAppenderConfig | RollingFileAppenderConfig;
export declare type AppenderConfigType = ConsoleAppenderConfig | FileAppenderConfig | RewriteAppenderConfig | RollingFileAppenderConfig;
```
10 changes: 0 additions & 10 deletions docs/settings/logging-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@

Refer to the <<log-settings-examples, examples>> for common configuration use cases. To learn more about possible configuration values, go to {kibana-ref}/logging-service.html[{kib}'s Logging service].

[[log-settings-compatibility]]
==== Backwards compatibility
Compatibility with the legacy logging system is assured until the end of the `v7` version.
All log messages handled by `root` context (default) are forwarded to the legacy logging service.
The logging configuration is validated against the predefined schema and if there are
any issues with it, {kib} will fail to start with the detailed error message.

NOTE: When you switch to the new logging configuration, you will start seeing duplicate log entries in both formats.
These will be removed when the `default` appender is no longer required.

[[log-settings-examples]]
==== Examples
Here are some configuration examples for the most common logging use cases:
Expand Down
11 changes: 10 additions & 1 deletion docs/user/production-considerations/production.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,21 @@ server.name
Settings unique across each host (for example, running multiple installations on the same virtual machine):
[source,js]
--------
logging.dest
path.data
pid.file
server.port
--------

When using a file appender, the target file must also be unique:
[source,yaml]
--------
logging:
appenders:
default:
type: file
fileName: /unique/path/per/instance
--------

Settings that must be the same:
[source,js]
--------
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"@elastic/ems-client": "7.15.0",
"@elastic/eui": "38.0.1",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/maki": "6.3.0",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand All @@ -113,12 +112,10 @@
"@hapi/accept": "^5.0.2",
"@hapi/boom": "^9.1.4",
"@hapi/cookie": "^11.0.2",
"@hapi/good-squeeze": "6.0.0",
"@hapi/h2o2": "^9.1.0",
"@hapi/hapi": "^20.2.0",
"@hapi/hoek": "^9.2.0",
"@hapi/inert": "^6.0.4",
"@hapi/podium": "^4.1.3",
"@hapi/wreck": "^17.1.0",
"@kbn/ace": "link:bazel-bin/packages/kbn-ace",
"@kbn/alerts": "link:bazel-bin/packages/kbn-alerts",
Expand All @@ -133,7 +130,6 @@
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n",
"@kbn/interpreter": "link:bazel-bin/packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils",
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging",
"@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl",
"@kbn/monaco": "link:bazel-bin/packages/kbn-monaco",
Expand Down
1 change: 0 additions & 1 deletion packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ filegroup(
"//packages/kbn-i18n:build",
"//packages/kbn-interpreter:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-legacy-logging:build",
"//packages/kbn-logging:build",
"//packages/kbn-mapbox-gl:build",
"//packages/kbn-monaco:build",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface BootstrapArgs {
}

export async function bootstrapDevMode({ configs, cliArgs, applyConfigOverrides }: BootstrapArgs) {
const log = new CliLog(!!cliArgs.quiet, !!cliArgs.silent);
const log = new CliLog(!!cliArgs.silent);

const env = Env.createDefault(REPO_ROOT, {
configs,
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-cli-dev-mode/src/cli_dev_mode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const createCliArgs = (parts: Partial<SomeCliArgs> = {}): SomeCliArgs => ({
runExamples: false,
watch: true,
silent: false,
quiet: false,
...parts,
});

Expand Down
5 changes: 2 additions & 3 deletions packages/kbn-cli-dev-mode/src/cli_dev_mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const GRACEFUL_TIMEOUT = 30000;

export type SomeCliArgs = Pick<
CliArgs,
| 'quiet'
| 'silent'
| 'verbose'
| 'disableOptimizer'
Expand Down Expand Up @@ -108,7 +107,7 @@ export class CliDevMode {
private subscription?: Rx.Subscription;

constructor({ cliArgs, config, log }: { cliArgs: SomeCliArgs; config: CliDevConfig; log?: Log }) {
this.log = log || new CliLog(!!cliArgs.quiet, !!cliArgs.silent);
this.log = log || new CliLog(!!cliArgs.silent);

if (cliArgs.basePath) {
this.basePathProxy = new BasePathProxyServer(this.log, config.http, config.dev);
Expand Down Expand Up @@ -163,7 +162,7 @@ export class CliDevMode {
runExamples: cliArgs.runExamples,
cache: cliArgs.cache,
dist: cliArgs.dist,
quiet: !!cliArgs.quiet,
quiet: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elastic/kibana-operations I kept the property in the Optimizer options and just set it to false to avoid more downstream changes. This can eventually be cleaned up as a follow-up (unless we really want to do it in current PR).

silent: !!cliArgs.silent,
verbose: !!cliArgs.verbose,
watch: cliArgs.watch,
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-cli-dev-mode/src/dev_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ describe('#run$', () => {
Array [
"foo",
"bar",
"--logging.json=false",
],
Object {
"env": Object {
Expand Down
8 changes: 4 additions & 4 deletions packages/kbn-cli-dev-mode/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ export interface Log {

export class CliLog implements Log {
public toolingLog = new ToolingLog({
level: this.silent ? 'silent' : this.quiet ? 'error' : 'info',
level: this.silent ? 'silent' : 'info',
writeTo: {
write: (msg) => {
this.write(msg);
},
},
});

constructor(private readonly quiet: boolean, private readonly silent: boolean) {}
constructor(private readonly silent: boolean) {}

good(label: string, ...args: any[]) {
if (this.quiet || this.silent) {
if (this.silent) {
return;
}

Expand All @@ -41,7 +41,7 @@ export class CliLog implements Log {
}

warn(label: string, ...args: any[]) {
if (this.quiet || this.silent) {
if (this.silent) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-cli-dev-mode/src/using_server_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function usingServerProcess<T>(
) {
return Rx.using(
(): ProcResource => {
const proc = execa.node(script, [...argv, '--logging.json=false'], {
const proc = execa.node(script, argv, {
stdio: 'pipe',
nodeOptions: [
...process.execArgv,
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-config/src/__mocks__/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export function getEnvOptions(options: DeepPartial<EnvOptions> = {}): EnvOptions
configs: options.configs || [],
cliArgs: {
dev: true,
quiet: false,
silent: false,
watch: false,
basePath: false,
Expand Down
6 changes: 0 additions & 6 deletions packages/kbn-config/src/__snapshots__/env.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/kbn-config/src/config_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
DeprecatedConfigDetails,
ChangedDeprecatedPaths,
} from './deprecation';
import { LegacyObjectToConfigAdapter } from './legacy';
import { ObjectToConfigAdapter } from './object_to_config_adapter';

/** @internal */
export type IConfigService = PublicMethodsOf<ConfigService>;
Expand Down Expand Up @@ -71,7 +71,7 @@ export class ConfigService {
map(([rawConfig, deprecations]) => {
const migrated = applyDeprecations(rawConfig, deprecations);
this.deprecatedConfigPaths.next(migrated.changedPaths);
return new LegacyObjectToConfigAdapter(migrated.config);
return new ObjectToConfigAdapter(migrated.config);
pgayvallet marked this conversation as resolved.
Show resolved Hide resolved
}),
tap((config) => {
this.lastConfig = config;
Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-config/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export interface EnvOptions {
export interface CliArgs {
dev: boolean;
envName?: string;
/** @deprecated */
quiet?: boolean;
silent?: boolean;
verbose?: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't sure if I should keep silent and verbose in CliArgs. Those are effectively unused inside core, as now their only usages is to change logging.root.level from src/cli/serve/serve.js, but at the same times, they're still cli args, so we may want to have them propagated to core for telemetry of some other need. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know how many users rely on silent and verbose cli flags? What bothers me is that we allow using them as CLI flags but not as config values. Btw we need to replace all the logging.* values in kibana.yml with their Kibana Logging system counterparts.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know how many users rely on silent and verbose cli flags? What bothers me is that we allow using them as CLI flags but not as config values.

Yeah this bugs me too -- IIRC when we had last discussed this (I think with @spalger ?), the case was made that configuring appenders via the CLI is more cumbersome than when working in the yaml, and that it was a minimal maintenance burden to keep silent and verbose in place, which is why we only deprecated quiet at the time.

watch: boolean;
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ export { Config, ConfigPath, isConfigPath, hasConfigPathIntersection } from './c
export { ObjectToConfigAdapter } from './object_to_config_adapter';
export { CliArgs, Env, RawPackageInfo } from './env';
export { EnvironmentMode, PackageInfo } from './types';
export { LegacyObjectToConfigAdapter, LegacyLoggingConfig } from './legacy';
export { getPluginSearchPaths } from './plugins';
Loading