switchActiveLogFile

fun switchActiveLogFile(newAbsoluteBasePath: String)

Switches the active Log4j2 file appender to write to newAbsoluteBasePath.

Preconditions:

  • Your Log4j2 configuration must reference the baseLogFileName system property (e.g., in the file appender fileName/filePattern).

Steps:

  1. Set baseLogFileName system property.

  2. Reconfigure the current LoggerContext.

Parameters

newAbsoluteBasePath

Absolute base path used by the file appender.