Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleResourceManagerGateway.java
public interface ResourceManagerGateway {


    /**
     * Changes the level of the logger at runtime.
     *
     * <p>By providing a {@code null} LogLevel, the previously-changed level is reverted to its
     * original value.
     *
     * @param loggerName the name of the logger
     * @param level the log level
     * @return future which is completed exceptionally if the operation fails
     */
    CompletableFuture<Void> changeLogLevel(String loggerName, @Nullable LogLevel level);
}

This RPC method will be called by the handler that serves the /logconfig request. When it is called, it does two thing,

  • It changes the logging level on this job manager.
  • It broadcasts this change to all the task managers that are currently registered on this job manager, by calling the RPC method TaskExecutorGateway.changeLogLevel as describe below.

TaskExecutorGateway

Code Block
languagejava
titleTaskExecutorGateway.java
public interface TaskExecutorGateway {

    /**
     * Change the level of the logger at runtime.
     *
     * <p>By providing a {@code null} LogLevel, the previously-changed level is reverted to its
     * original value.
     *
     * @param loggerName the name of the logger
     * @param level the log level
     * @return future which is completed exceptionally if the operation fails
     */
    CompletableFuture<Void> changeLogLevel(String loggerName, @Nullable LogLevel level);
}

When this method is called by a ResourceManager, it does only one thing: changes the logging level on this task manager.

Logging Abstraction

The only thing left is how the logging level is changed on a job manager or task managers. Although log4j2 is the default logging implementation that is included in the distribution libraries, other logging frameworks, including log4j1 and logback, are also recommended by the documentation "How to use logging". We need to have some kind of abstraction to not directly depend on the logging implementation. Provide interfaces that not only suit the currently supported ones but also logging frameworks developed in the future.

TBD

Limitations

TBD

Compatibility, Deprecation, and Migration Plan

...