com.google.cloud.dataflow.sdk.options

## Class DataflowWorkerLoggingOptions.WorkerLogLevelOverrides

- java.lang.Object
- - java.util.AbstractMap<K,V>
  - - java.util.HashMap<String,DataflowWorkerLoggingOptions.Level>
    - - com.google.cloud.dataflow.sdk.options.DataflowWorkerLoggingOptions.WorkerLogLevelOverrides

All Implemented Interfaces:
  Serializable, Cloneable, Map<String,DataflowWorkerLoggingOptions.Level>

Enclosing interface:
  DataflowWorkerLoggingOptions

    public static class DataflowWorkerLoggingOptions.WorkerLogLevelOverrides
    extends HashMap<String,DataflowWorkerLoggingOptions.Level>

Defines a log level override for a specific class, package, or name.

`java.util.logging` is used on the Dataflow worker harness and supports a logging hierarchy based off of names that are "." separated. It is a common pattern to have the logger for a given class share the same name as the class itself. Given the classes `a.b.c.Foo`, `a.b.c.Xyz`, and `a.b.Bar`, with loggers named `"a.b.c.Foo"`, `"a.b.c.Xyz"`, and `"a.b.Bar"` respectively, we can override the log levels:

- for `Foo` by specifying the name `"a.b.c.Foo"` or the `Class` representing `a.b.c.Foo`.
- for `Foo`, `Xyz`, and `Bar` by specifying the name `"a.b"` or the `Package` representing `a.b`.
- for `Foo` and `Bar` by specifying both of their names or classes.

Note that by specifying multiple overrides, the exact name followed by the closest parent takes precedence.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.AbstractMap

`AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

### Nested classes/interfaces inherited from interface java.util.Map

`Map.Entry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`WorkerLogLevelOverrides()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`DataflowWorkerLoggingOptions.WorkerLogLevelOverrides` `addOverrideForClass(Class<?> klass, DataflowWorkerLoggingOptions.Level level)` Overrides the default log level for the passed in class.
`DataflowWorkerLoggingOptions.WorkerLogLevelOverrides` `addOverrideForName(String name, DataflowWorkerLoggingOptions.Level level)` Overrides the default log level for the passed in name.
`DataflowWorkerLoggingOptions.WorkerLogLevelOverrides` `addOverrideForPackage(Package pkg, DataflowWorkerLoggingOptions.Level level)` Overrides the default log level for the passed in package.
`static DataflowWorkerLoggingOptions.WorkerLogLevelOverrides` `from(Map<String,String> values)` Expects a map keyed by logger `Name`s with values representing `Level`s.

### Methods inherited from class java.util.HashMap

`clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values`

### Methods inherited from class java.util.AbstractMap

`equals, hashCode, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Map

`equals, hashCode`

### Constructor Detail

#### WorkerLogLevelOverrides

    public WorkerLogLevelOverrides()

### Method Detail

#### addOverrideForClass

    public DataflowWorkerLoggingOptions.WorkerLogLevelOverrides addOverrideForClass(Class<?> klass,
                                                                                    DataflowWorkerLoggingOptions.Level level)

Overrides the default log level for the passed in class.

This is equivalent to calling `addOverrideForName(String, DataflowWorkerLoggingOptions.Level)` and passing in the `class name`.

#### addOverrideForPackage

    public DataflowWorkerLoggingOptions.WorkerLogLevelOverrides addOverrideForPackage(Package pkg,
                                                                                      DataflowWorkerLoggingOptions.Level level)

Overrides the default log level for the passed in package.

This is equivalent to calling `addOverrideForName(String, DataflowWorkerLoggingOptions.Level)` and passing in the `package name`.

#### addOverrideForName

    public DataflowWorkerLoggingOptions.WorkerLogLevelOverrides addOverrideForName(String name,
                                                                                   DataflowWorkerLoggingOptions.Level level)

Overrides the default log level for the passed in name.

Note that because of the hierarchical nature of logger names, this will override the log level of all loggers that have the passed in name or a parent logger that has the passed in name.

#### from

    public static DataflowWorkerLoggingOptions.WorkerLogLevelOverrides from(Map<String,String> values)

Expects a map keyed by logger `Name`s with values representing `Level`s. The `Name` generally represents the fully qualified Java `class name`, or fully qualified Java `package name`, or custom logger name. The `Level` represents the log level and must be one of `DataflowWorkerLoggingOptions.Level`.