Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rarkins committed Apr 22, 2021
1 parent 5701504 commit 95ac109
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 30 deletions.
12 changes: 0 additions & 12 deletions docs/usage/self-hosted-configuration.md
Expand Up @@ -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:
Expand Down
7 changes: 0 additions & 7 deletions lib/config/definitions.ts
Expand Up @@ -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.',
Expand Down
11 changes: 1 addition & 10 deletions 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';
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion lib/config/types.ts
Expand Up @@ -74,7 +74,6 @@ export interface GlobalOnlyConfig {
gitPrivateKey?: string;
logFile?: string;
logFileLevel?: LogLevel;
logLevel?: LogLevel;
prCommitsPerRunLimit?: number;
privateKeyPath?: string;
redisUrl?: string;
Expand Down

0 comments on commit 95ac109

Please sign in to comment.