applyLogLevelMap

@CanIgnoreReturnValue()
public static boolean applyLogLevelMap(LogLevelMap logLevelMap)

Applies the given log level map to the current context.

Warning: It is always better to create a new context via newContext rather than attempting to modify an existing context. In order of preference you should:

  1. Call or wrap a new context with metadata added to it.
  2. install() a new context and close it when you it exits (e.g. if you are using callbacks to listen to state changes in a task). However it is vital that the returned ScopedLoggingContext.LogContextCloseable is always closed.
  3. Call this method and check that it succeeded (e.g. logging a warning if it fails).
Log level settings are merged with any existing setting from the current (or parent) contexts such that logging will be enabled for a log statement if:
  • It was enabled by the given map.
  • It was already enabled by the current context.

The effects of this call will be undone only when the current context terminates.

Return

false if there is no current context, or scoped contexts are not supported.