Log Manager
Logging utilities: path helpers, log file switching, and root level updates.
This helper assumes your Log4j2 configuration references the system property baseLogFileName
(e.g., using ${sys:baseLogFileName}
in the RollingFile
appender).
Notes:
This object’s name intentionally matches Log4j’s type name. Calls to Log4j's static helpers are fully qualified through imports (e.g., LogManager.getContext) and remain unambiguous.
All path helpers ensure the
${Constants.NEWBESTSUB_PATH}/log/
directory exists.
Functions
Builds the absolute path of the final parameterized log file (no subfolder).
Ensures that the log directory exists under NEWBESTSUB_PATH/log/
and returns its absolute path with a trailing path separator.
Returns the absolute path of the bootstrap log file used from program start, before parameters are known. Ensures the log directory exists.
Promotes the bootstrap log to the final parameterized log:
Switches the active Log4j2 file appender to write to newAbsoluteBasePath.
Updates the root logger level and refreshes all loggers in the current context.