diff --git a/src/core/server/elasticsearch/client/log_query_and_deprecation.test.ts b/src/core/server/elasticsearch/client/log_query_and_deprecation.test.ts index c4c426cdf6c8..dcdfad14e07b 100644 --- a/src/core/server/elasticsearch/client/log_query_and_deprecation.test.ts +++ b/src/core/server/elasticsearch/client/log_query_and_deprecation.test.ts @@ -540,14 +540,13 @@ describe('instrumentQueryAndDeprecationLogger', () => { }); client.diagnostic.emit('response', new errors.ResponseError(response), response); - // One debug log entry from 'elasticsearch.query' context - expect(loggingSystemMock.collect(logger).debug.length).toEqual(1); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch( + // Test debug[1] since theree is one log entry from 'elasticsearch.query' context + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch( 'Elasticsearch deprecation: 299 Elasticsearch-8.1.0 "GET /_path is deprecated"' ); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch('Origin:kibana'); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch(/Stack trace:\n.*at/); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch( + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch('Origin:kibana'); + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch(/Stack trace:\n.*at/); + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch( /Query:\n.*400\n.*GET \/_path\?hello\=dolly \[illegal_argument_exception\]: request \[\/_path\] contains unrecognized parameter: \[name\]/ ); }); @@ -573,7 +572,6 @@ describe('instrumentQueryAndDeprecationLogger', () => { }); client.diagnostic.emit('response', null, response); - expect(loggingSystemMock.collect(logger).info).toEqual([]); // Test debug[1] since theree is one log entry from 'elasticsearch.query' context expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch( 'Elasticsearch deprecation: 299 Elasticsearch-8.1.0 "GET /_path is deprecated"' @@ -608,14 +606,13 @@ describe('instrumentQueryAndDeprecationLogger', () => { }); client.diagnostic.emit('response', null, response); - // One debug log entry from 'elasticsearch.query' context - expect(loggingSystemMock.collect(logger).debug.length).toEqual(1); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch( + // Test debug[1] since theree is one log entry from 'elasticsearch.query' context + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch( 'Elasticsearch deprecation: 299 Elasticsearch-8.1.0 "GET /_path is deprecated"' ); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch('Origin:kibana'); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch(/Stack trace:\n.*at/); - expect(loggingSystemMock.collect(logger).info[0][0]).toMatch( + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch('Origin:kibana'); + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch(/Stack trace:\n.*at/); + expect(loggingSystemMock.collect(logger).debug[1][0]).toMatch( /Query:\n.*200\n.*GET \/_path\?hello\=dolly/ ); }); diff --git a/src/core/server/elasticsearch/client/log_query_and_deprecation.ts b/src/core/server/elasticsearch/client/log_query_and_deprecation.ts index b017fce0e342..e371f9f25ad8 100644 --- a/src/core/server/elasticsearch/client/log_query_and_deprecation.ts +++ b/src/core/server/elasticsearch/client/log_query_and_deprecation.ts @@ -139,12 +139,9 @@ export const instrumentEsQueryAndDeprecationLogger = ({ // Strip the first 5 stack trace lines as these are irrelavent to finding the call site const stackTrace = new Error().stack?.split('\n').slice(5).join('\n'); - const deprecationMsg = `Elasticsearch deprecation: ${event.warnings}\nOrigin:${requestOrigin}\nStack trace:\n${stackTrace}\nQuery:\n${queryMsg}`; - if (requestOrigin === 'kibana') { - deprecationLogger.info(deprecationMsg); - } else { - deprecationLogger.debug(deprecationMsg); - } + deprecationLogger.debug( + `Elasticsearch deprecation: ${event.warnings}\nOrigin:${requestOrigin}\nStack trace:\n${stackTrace}\nQuery:\n${queryMsg}` + ); } } }); diff --git a/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts b/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts index 139cd298d28e..79a49b251809 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/7.7.2_xpack_100k.test.ts @@ -63,6 +63,7 @@ describe('migration from 7.7.2-xpack with 100k objects', () => { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts b/src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts index 479b1e78e1b7..48bcdd6e5eac 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/7_13_0_failed_action_tasks.test.ts @@ -128,6 +128,7 @@ function createRoot() { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts b/src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts index c8e17a64a3fa..e24cfe0d90c2 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/7_13_0_transform_failures.test.ts @@ -170,6 +170,7 @@ function createRoot() { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts b/src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts index 27107d4df27f..dc521baad633 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/7_13_0_unknown_types.test.ts @@ -124,6 +124,7 @@ function createRoot() { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts b/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts index 292151c2f401..331284c14cf0 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes.test.ts @@ -154,6 +154,7 @@ function createRoot(options: { maxBatchSizeBytes?: number }) { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts b/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts index 7d55446b5432..8098735ecfdb 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/batch_size_bytes_exceeds_es_content_length.test.ts @@ -105,6 +105,7 @@ function createRoot(options: { maxBatchSizeBytes?: number }) { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/collects_corrupt_docs.test.ts b/src/core/server/saved_objects/migrations/integration_tests/collects_corrupt_docs.test.ts index e5f0206b091f..67bff2e4e151 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/collects_corrupt_docs.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/collects_corrupt_docs.test.ts @@ -165,6 +165,7 @@ function createRoot() { { name: 'root', appenders: ['file'], + level: 'info', }, ], }, diff --git a/src/core/server/saved_objects/migrations/integration_tests/corrupt_outdated_docs.test.ts b/src/core/server/saved_objects/migrations/integration_tests/corrupt_outdated_docs.test.ts index ebc632f059ce..80ac5369c087 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/corrupt_outdated_docs.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/corrupt_outdated_docs.test.ts @@ -169,6 +169,7 @@ function createRoot() { { name: 'root', appenders: ['file'], + level: 'info', }, ], }, diff --git a/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts b/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts index c341463b7891..8c71cf3a29ef 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/migration_from_older_v1.test.ts @@ -94,6 +94,7 @@ describe('migrating from 7.3.0-xpack which used v1 migrations', () => { { name: 'root', appenders: ['file'], + level: 'info', }, ], }, diff --git a/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts b/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts index 34d1317755c1..1fa739768e41 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/migration_from_same_v1.test.ts @@ -94,6 +94,7 @@ describe('migrating from the same Kibana version that used v1 migrations', () => { name: 'root', appenders: ['file'], + level: 'info', }, ], }, diff --git a/src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts b/src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts index fabc9222b685..ae8ae6bcc308 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/multiple_es_nodes.test.ts @@ -83,6 +83,7 @@ function createRoot({ logFileName, hosts }: RootConfig) { { name: 'root', appenders: ['file'], + level: 'info', }, ], }, diff --git a/src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts b/src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts index 5d0d662a5360..9830d3bf954c 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/multiple_kibana_nodes.test.ts @@ -83,6 +83,7 @@ async function createRoot({ logFileName }: CreateRootConfig) { { name: 'root', appenders: ['file'], + level: 'info', }, { name: 'savedobjects-service', diff --git a/src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts b/src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts index 9fd8f3884c4a..b40fcda246c3 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/outdated_docs.test.ts @@ -109,6 +109,7 @@ function createRoot() { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts b/src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts index 2fd1ce9b6b14..79e55ef5beee 100644 --- a/src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts +++ b/src/core/server/saved_objects/migrations/integration_tests/rewriting_id.test.ts @@ -76,6 +76,7 @@ function createRoot() { loggers: [ { name: 'root', + level: 'info', appenders: ['file'], }, ], diff --git a/src/core/test_helpers/kbn_server.ts b/src/core/test_helpers/kbn_server.ts index a47ea14ba5a6..a63a8d406db4 100644 --- a/src/core/test_helpers/kbn_server.ts +++ b/src/core/test_helpers/kbn_server.ts @@ -109,6 +109,25 @@ export function createRootWithCorePlugins(settings = {}, cliArgs: Partial