From 95ac10998cdc9ec3a65d7e1dcf84002743acf29b Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Sun, 4 Apr 2021 10:58:32 +0200 Subject: [PATCH] feat: remove logLevel support in config (#9390) Remove support for logLevel in config. Must be configured using LOG_LEVEL instead. Closes #8291 BREAKING CHANGE: Configure LOG_LEVEL in env and not in config or CLI --- docs/usage/self-hosted-configuration.md | 12 ------------ lib/config/definitions.ts | 7 ------- lib/config/index.ts | 11 +---------- lib/config/types.ts | 1 - 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md index b6673d42fc629a..93af532f4906e1 100644 --- a/docs/usage/self-hosted-configuration.md +++ b/docs/usage/self-hosted-configuration.md @@ -233,18 +233,6 @@ If left as default (null), a random short ID will be selected. ## logFileLevel -## logLevel - -We recommend that you run the Renovate bot at the debug level if you can. -Use the environment variable `LOG_LEVEL=debug` to run Renovate at the debug level. - -When you use `LOG_LEVEL=debug`, debug logging starts from the beginning of the app. -If you had configured debug logging in a file config, then the debug logging starts _after_ the file config is parsed. - -Additionally, if you configure `LOG_FORMAT=json` in env then logging will be done in JSON format instead of "pretty" format, which is usually better if you're doing any ingestion or parsing of the logs. - -Warning: Configuring `logLevel` config option or `--log-level` cli option is deprecated and will be removed in a major version. - ## onboarding Set this to `false` only if all three statements are true: diff --git a/lib/config/definitions.ts b/lib/config/definitions.ts index ecc1d455c5f7b1..5bf8d99305ef2b 100644 --- a/lib/config/definitions.ts +++ b/lib/config/definitions.ts @@ -294,13 +294,6 @@ const options: RenovateOptions[] = [ admin: true, }, // Log options - { - name: 'logLevel', - description: 'Logging level. Deprecated, use `LOG_LEVEL` environment.', - stage: 'global', - type: 'string', - allowedValues: ['fatal', 'error', 'warn', 'info', 'debug', 'trace'], - }, { name: 'logFile', description: 'Log file path.', diff --git a/lib/config/index.ts b/lib/config/index.ts index 6fbe43fc3c351c..a005f9bf1ee8ed 100644 --- a/lib/config/index.ts +++ b/lib/config/index.ts @@ -1,4 +1,4 @@ -import { addStream, levels, logger, setContext } from '../logger'; +import { addStream, logger, setContext } from '../logger'; import { get, getLanguageList, getManagerList } from '../manager'; import { ensureDir, getSubDirectory, readFile } from '../util/fs'; import { ensureTrailingSlash } from '../util/url'; @@ -75,15 +75,6 @@ export async function parseConfigs( delete config.privateKeyPath; } - // Deprecated set log level: https://github.com/renovatebot/renovate/issues/8291 - // istanbul ignore if - if (config.logLevel) { - logger.warn( - 'Configuring logLevel in CLI or file is deprecated. Use LOG_LEVEL environment variable instead' - ); - levels('stdout', config.logLevel); - } - if (config.logContext) { // This only has an effect if logContext was defined via file or CLI, otherwise it would already have been detected in env setContext(config.logContext); diff --git a/lib/config/types.ts b/lib/config/types.ts index 21806dd46c7ec6..b2c9ca6b37fb42 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -74,7 +74,6 @@ export interface GlobalOnlyConfig { gitPrivateKey?: string; logFile?: string; logFileLevel?: LogLevel; - logLevel?: LogLevel; prCommitsPerRunLimit?: number; privateKeyPath?: string; redisUrl?: string;