@@ -11,7 +11,10 @@ import { ConfigDeprecationProvider, ConfigDeprecation } from '@kbn/config';
1111const configPathDeprecation : ConfigDeprecation = ( settings , fromPath , addDeprecation ) => {
1212 if ( process . env ?. CONFIG_PATH ) {
1313 addDeprecation ( {
14- message : `Environment variable CONFIG_PATH is deprecated. It has been replaced with KBN_PATH_CONF pointing to a config folder` ,
14+ message : `Environment variable "CONFIG_PATH" is deprecated. It has been replaced with "KBN_PATH_CONF" pointing to a config folder` ,
15+ correctiveActions : {
16+ manualSteps : [ 'Use "KBN_PATH_CONF" instead of "CONFIG_PATH" to point to a config folder.' ] ,
17+ } ,
1518 } ) ;
1619 }
1720} ;
@@ -20,6 +23,11 @@ const dataPathDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
2023 if ( process . env ?. DATA_PATH ) {
2124 addDeprecation ( {
2225 message : `Environment variable "DATA_PATH" will be removed. It has been replaced with kibana.yml setting "path.data"` ,
26+ correctiveActions : {
27+ manualSteps : [
28+ `Set 'path.data' in the config file or CLI flag with the value of the environment variable "DATA_PATH".` ,
29+ ] ,
30+ } ,
2331 } ) ;
2432 }
2533} ;
@@ -32,6 +40,12 @@ const rewriteBasePathDeprecation: ConfigDeprecation = (settings, fromPath, addDe
3240 'will expect that all requests start with server.basePath rather than expecting you to rewrite ' +
3341 'the requests in your reverse proxy. Set server.rewriteBasePath to false to preserve the ' +
3442 'current behavior and silence this warning.' ,
43+ correctiveActions : {
44+ manualSteps : [
45+ `Set 'server.rewriteBasePath' in the config file, CLI flag, or environment variable (in Docker only).` ,
46+ `Set to false to preserve the current behavior and silence this warning.` ,
47+ ] ,
48+ } ,
3549 } ) ;
3650 }
3751} ;
@@ -41,6 +55,11 @@ const rewriteCorsSettings: ConfigDeprecation = (settings, fromPath, addDeprecati
4155 if ( typeof corsSettings === 'boolean' ) {
4256 addDeprecation ( {
4357 message : '"server.cors" is deprecated and has been replaced by "server.cors.enabled"' ,
58+ correctiveActions : {
59+ manualSteps : [
60+ `Replace "server.cors: ${ corsSettings } " with "server.cors.enabled: ${ corsSettings } "` ,
61+ ] ,
62+ } ,
4463 } ) ;
4564
4665 return {
@@ -72,6 +91,9 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
7291 if ( sourceList . find ( ( source ) => source . includes ( NONCE_STRING ) ) ) {
7392 addDeprecation ( {
7493 message : `csp.rules no longer supports the {nonce} syntax. Replacing with 'self' in ${ policy } ` ,
94+ correctiveActions : {
95+ manualSteps : [ `Replace {nonce} syntax with 'self' in ${ policy } ` ] ,
96+ } ,
7597 } ) ;
7698 sourceList = sourceList . filter ( ( source ) => ! source . includes ( NONCE_STRING ) ) ;
7799
@@ -87,6 +109,9 @@ const cspRulesDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecati
87109 ) {
88110 addDeprecation ( {
89111 message : `csp.rules must contain the 'self' source. Automatically adding to ${ policy } .` ,
112+ correctiveActions : {
113+ manualSteps : [ `Add 'self' source to ${ policy } .` ] ,
114+ } ,
90115 } ) ;
91116 sourceList . push ( SELF_STRING ) ;
92117 }
@@ -111,6 +136,12 @@ const mapManifestServiceUrlDeprecation: ConfigDeprecation = (
111136 'of the Elastic Maps Service settings. These settings have moved to the "map.emsTileApiUrl" and ' +
112137 '"map.emsFileApiUrl" settings instead. These settings are for development use only and should not be ' +
113138 'modified for use in production environments.' ,
139+ correctiveActions : {
140+ manualSteps : [
141+ `Use "map.emsTileApiUrl" and "map.emsFileApiUrl" config instead of "map.manifestServiceUrl".` ,
142+ `These settings are for development use only and should not be modified for use in production environments.` ,
143+ ] ,
144+ } ,
114145 } ) ;
115146 }
116147} ;
@@ -125,12 +156,28 @@ const opsLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDe
125156 'in 8.0. To access ops data moving forward, please enable debug logs for the ' +
126157 '"metrics.ops" context in your logging configuration. For more details, see ' +
127158 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx' ,
159+ correctiveActions : {
160+ manualSteps : [
161+ `Remove "logging.events.ops" from your kibana settings.` ,
162+ `Enable debug logs for the "metrics.ops" context in your logging configuration` ,
163+ ] ,
164+ } ,
128165 } ) ;
129166 }
130167} ;
131168
132169const requestLoggingEventDeprecation : ConfigDeprecation = ( settings , fromPath , addDeprecation ) => {
133170 if ( settings . logging ?. events ?. request || settings . logging ?. events ?. response ) {
171+ const removeConfigsSteps = [ ] ;
172+
173+ if ( settings . logging ?. events ?. request ) {
174+ removeConfigsSteps . push ( `Remove "logging.events.request" from your kibana configs.` ) ;
175+ }
176+
177+ if ( settings . logging ?. events ?. response ) {
178+ removeConfigsSteps . push ( `Remove "logging.events.response" from your kibana configs.` ) ;
179+ }
180+
134181 addDeprecation ( {
135182 documentationUrl :
136183 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents' ,
@@ -139,6 +186,12 @@ const requestLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, a
139186 'in 8.0. To access request and/or response data moving forward, please enable debug logs for the ' +
140187 '"http.server.response" context in your logging configuration. For more details, see ' +
141188 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx' ,
189+ correctiveActions : {
190+ manualSteps : [
191+ ...removeConfigsSteps ,
192+ `enable debug logs for the "http.server.response" context in your logging configuration.` ,
193+ ] ,
194+ } ,
142195 } ) ;
143196 }
144197} ;
@@ -153,6 +206,12 @@ const timezoneLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDe
153206 'in 8.0. To set the timezone moving forward, please add a timezone date modifier to the log pattern ' +
154207 'in your logging configuration. For more details, see ' +
155208 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx' ,
209+ correctiveActions : {
210+ manualSteps : [
211+ `Remove "logging.timezone" from your kibana configs.` ,
212+ `To set the timezone add a timezone date modifier to the log pattern in your logging configuration.` ,
213+ ] ,
214+ } ,
156215 } ) ;
157216 }
158217} ;
@@ -167,6 +226,12 @@ const destLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprec
167226 'in 8.0. To set the destination moving forward, you can use the "console" appender ' +
168227 'in your logging configuration or define a custom one. For more details, see ' +
169228 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx' ,
229+ correctiveActions : {
230+ manualSteps : [
231+ `Remove "logging.dest" from your kibana configs.` ,
232+ `To set the destination use the "console" appender in your logging configuration or define a custom one.` ,
233+ ] ,
234+ } ,
170235 } ) ;
171236 }
172237} ;
@@ -179,6 +244,12 @@ const quietLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDepre
179244 message :
180245 '"logging.quiet" has been deprecated and will be removed ' +
181246 'in 8.0. Moving forward, you can use "logging.root.level:error" in your logging configuration. ' ,
247+ correctiveActions : {
248+ manualSteps : [
249+ `Remove "logging.quiet" from your kibana configs.` ,
250+ `Use "logging.root.level:error" in your logging configuration.` ,
251+ ] ,
252+ } ,
182253 } ) ;
183254 }
184255} ;
@@ -191,6 +262,12 @@ const silentLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDepr
191262 message :
192263 '"logging.silent" has been deprecated and will be removed ' +
193264 'in 8.0. Moving forward, you can use "logging.root.level:off" in your logging configuration. ' ,
265+ correctiveActions : {
266+ manualSteps : [
267+ `Remove "logging.silent" from your kibana configs.` ,
268+ `Use "logging.root.level:off" in your logging configuration.` ,
269+ ] ,
270+ } ,
194271 } ) ;
195272 }
196273} ;
@@ -203,6 +280,12 @@ const verboseLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDep
203280 message :
204281 '"logging.verbose" has been deprecated and will be removed ' +
205282 'in 8.0. Moving forward, you can use "logging.root.level:all" in your logging configuration. ' ,
283+ correctiveActions : {
284+ manualSteps : [
285+ `Remove "logging.verbose" from your kibana configs.` ,
286+ `Use "logging.root.level:all" in your logging configuration.` ,
287+ ] ,
288+ } ,
206289 } ) ;
207290 }
208291} ;
@@ -223,6 +306,12 @@ const jsonLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprec
223306 'There is currently no default layout for custom appenders and each one must be declared explicitly. ' +
224307 'For more details, see ' +
225308 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx' ,
309+ correctiveActions : {
310+ manualSteps : [
311+ `Remove "logging.json" from your kibana configs.` ,
312+ `Configure the "appender.layout" property for every custom appender in your logging configuration.` ,
313+ ] ,
314+ } ,
226315 } ) ;
227316 }
228317} ;
@@ -237,6 +326,12 @@ const logRotateDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecat
237326 'Moving forward, you can enable log rotation using the "rolling-file" appender for a logger ' +
238327 'in your logging configuration. For more details, see ' +
239328 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender' ,
329+ correctiveActions : {
330+ manualSteps : [
331+ `Remove "logging.rotate" from your kibana configs.` ,
332+ `Enable log rotation using the "rolling-file" appender for a logger in your logging configuration.` ,
333+ ] ,
334+ } ,
240335 } ) ;
241336 }
242337} ;
@@ -248,7 +343,13 @@ const logEventsLogDeprecation: ConfigDeprecation = (settings, fromPath, addDepre
248343 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents' ,
249344 message :
250345 '"logging.events.log" has been deprecated and will be removed ' +
251- 'in 8.0. Moving forward, log levels can be customized on a per-logger basis using the new logging configuration. ' ,
346+ 'in 8.0. Moving forward, log levels can be customized on a per-logger basis using the new logging configuration.' ,
347+ correctiveActions : {
348+ manualSteps : [
349+ `Remove "logging.events.log" from your kibana configs.` ,
350+ `Customize log levels can be per-logger using the new logging configuration.` ,
351+ ] ,
352+ } ,
252353 } ) ;
253354 }
254355} ;
@@ -260,7 +361,13 @@ const logEventsErrorDeprecation: ConfigDeprecation = (settings, fromPath, addDep
260361 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents' ,
261362 message :
262363 '"logging.events.error" has been deprecated and will be removed ' +
263- 'in 8.0. Moving forward, you can use "logging.root.level: error" in your logging configuration. ' ,
364+ 'in 8.0. Moving forward, you can use "logging.root.level: error" in your logging configuration.' ,
365+ correctiveActions : {
366+ manualSteps : [
367+ `Remove "logging.events.error" from your kibana configs.` ,
368+ `Use "logging.root.level: error" in your logging configuration.` ,
369+ ] ,
370+ } ,
264371 } ) ;
265372 }
266373} ;
@@ -271,6 +378,9 @@ const logFilterDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecat
271378 documentationUrl :
272379 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingfilter' ,
273380 message : '"logging.filter" has been deprecated and will be removed in 8.0.' ,
381+ correctiveActions : {
382+ manualSteps : [ `Remove "logging.filter" from your kibana configs.` ] ,
383+ } ,
274384 } ) ;
275385 }
276386} ;
0 commit comments