Class AgentLogManagerLog4j2Impl

  • All Implemented Interfaces:
    AgentLogManager

    public final class AgentLogManagerLog4j2Impl
    extends java.lang.Object
    implements AgentLogManager
    Utility class that locates and relocates the agent log file. This implementation is based on log4j2.
    Since:
    4.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      AgentLogManagerLog4j2Impl​(org.apache.logging.log4j.core.LoggerContext context)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.file.Path getLogFilePath()
      Get the current location of the agent log file.
      void relocateLogFile​(java.nio.file.Path destinationPath)
      Attempt to relocate the agent log file inside the job directory.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AgentLogManagerLog4j2Impl

        public AgentLogManagerLog4j2Impl​(org.apache.logging.log4j.core.LoggerContext context)
        Constructor.
        Parameters:
        context - the log4j2 logger context
    • Method Detail

      • getLogFilePath

        public java.nio.file.Path getLogFilePath()
        Get the current location of the agent log file.
        Specified by:
        getLogFilePath in interface AgentLogManager
        Returns:
        a path string
      • relocateLogFile

        public void relocateLogFile​(java.nio.file.Path destinationPath)
                             throws java.io.IOException
        Attempt to relocate the agent log file inside the job directory.
        Specified by:
        relocateLogFile in interface AgentLogManager
        Parameters:
        destinationPath - the destination path
        Throws:
        java.io.IOException - if relocation fails