code: public void configureGlobalFileLog(RootLoggerConfig config, File logDir, String logPattern) {
      String appenderRef = writeFileAppender(config, logDir, logPattern);
  
      putProperty(ROOT_LOGGER_NAME + ".appenderRef." + appenderRef + ".ref", appenderRef);
    }
docs: Make log4j2 configuration for a process to push all its logs to a log file.
  <p>
  <ul>
  <li>the file's name will use the prefix defined in {@link RootLoggerConfig#getProcessId()#getLogFilenamePrefix()}.</li>
  <li>the file will follow the rotation policy defined in property {@link #ROLLING_POLICY_PROPERTY} and
  the max number of files defined in property {@link #MAX_FILES_PROPERTY}</li>
  <li>the logs will follow the specified log pattern</li>
  </ul>
  </p>
  
  @see #buildLogPattern(RootLoggerConfig)