Class Log4j2Logging

java.lang.Object
ch.autumo.commons.logging.AbstractLogging
ch.autumo.commons.logging.Log4j2Logging
All Implemented Interfaces:
Logging

public class Log4j2Logging extends AbstractLogging
Log4j2 Logging initialization.
  • Field Details

    • SYSTEM_PROPERTY_LOG_FILE

      public static String SYSTEM_PROPERTY_LOG_FILE
      Log file
  • Constructor Details

    • Log4j2Logging

      public Log4j2Logging()
      Default constructor.
  • Method Details

    • initialize

      public String initialize() throws IOException
      Description copied from interface: Logging
      Initialize logging and return logging file path.
      - Path used: 'cfg/logging.xml'
      - Configuration name used: 'default'
      Returns:
      logging file path
      Throws:
      IOException - when reading the configuration fails
    • initialize

      public void initialize(String path, String name) throws IOException
      Description copied from interface: Logging
      Configure the framework specifically with a log configuration file and name!
      Parameters:
      path - a path to the configuration
      name - name to the configuration
      Throws:
      IOException - when reading the configuration fails
    • initializeInMemoryFile

      public void initializeInMemoryFile(String inMemoryConfigName, String appName)
      Description copied from interface: Logging
      Initialize logging with an in-memory-built log4j2 configuration and appends output to file. Note: Might have an implementation or not.
      Parameters:
      inMemoryConfigName - virtual configuration name
      appName - application name that is is used as part of the logging output folder
    • initializeInMemoryConsole

      public void initializeInMemoryConsole(String inMemoryConfigName, String appName)
      Description copied from interface: Logging
      Initialize logging with an in-memory-built log4j2 configuration Note: Might have an implementation or not.
      Parameters:
      inMemoryConfigName - virtual configuration name
      appName - application name that is is used as part of the logging output folder
    • initializeInMemory

      public void initializeInMemory(String inMemoryConfigName, String appName, org.apache.logging.log4j.Level level, String appenderRef, String packageName)
      Initialize logging with an in-memory-built log4j2 configuration
      Parameters:
      inMemoryConfigName - virtual configuration name
      appName - application name that is is used as part of the logging output folder and log file name
      level - log level
      appenderRef - file|console
      packageName - package name