Class EphemeralAgentManagementLoggerImpl

java.lang.Object
com.atlassian.bamboo.agent.ephemeral.logging.EphemeralAgentManagementLoggerImpl
All Implemented Interfaces:
EphemeralAgentManagementLogger

public class EphemeralAgentManagementLoggerImpl extends Object implements EphemeralAgentManagementLogger
  • Constructor Details

    • EphemeralAgentManagementLoggerImpl

      public EphemeralAgentManagementLoggerImpl()
    • EphemeralAgentManagementLoggerImpl

      protected EphemeralAgentManagementLoggerImpl(int logSize)
  • Method Details

    • addEphemeralLogEntry

      public void addEphemeralLogEntry(@NotNull @NotNull org.apache.logging.log4j.Logger logger, @NotNull @NotNull String message, boolean isSuccessfulMessage)
      Description copied from interface: EphemeralAgentManagementLogger
      Adds the log entry to the N last ephemeral logs and evicts the oldest one if the capacity is reached. Also, the method immediately logs the message to the Bamboo instance logs with the provided logger.
      Specified by:
      addEphemeralLogEntry in interface EphemeralAgentManagementLogger
      Parameters:
      logger - logger used to log the message to Bamboo logs
      message - information to keep
      isSuccessfulMessage - whether the passed message indicates the successful action
    • addEphemeralLogEntry

      public void addEphemeralLogEntry(@NotNull @NotNull org.apache.logging.log4j.Logger logger, @NotNull @NotNull String message, @NotNull @NotNull AgentMaintenanceResult clusterCommunicationResult)
      Description copied from interface: EphemeralAgentManagementLogger
      Adds the log entry to the N last ephemeral logs and evicts the oldest one if the capacity is reached. The log entry contains both the message and cluster-related communication result associated with the message. Also, the method immediately logs the message to the Bamboo instance logs with the provided logger. The Successful result will be printed. In order to reduce noise, use EphemeralAgentManagementLogger.addEphemeralLogEntry(Logger, String, AgentMaintenanceResult, boolean, boolean) with printSuccessfulResult and logOnlyToEphemeralLogger set to true
      Specified by:
      addEphemeralLogEntry in interface EphemeralAgentManagementLogger
      Parameters:
      logger - logger used to log the message to Bamboo logs
      message - information to keep
      clusterCommunicationResult - cluster communication result
    • addEphemeralLogEntry

      public void addEphemeralLogEntry(@NotNull @NotNull org.apache.logging.log4j.Logger logger, @NotNull @NotNull String message, @NotNull @NotNull AgentMaintenanceResult clusterCommunicationResult, boolean printSuccessfulResult, boolean logOnlyToEphemeralConsole)
      Description copied from interface: EphemeralAgentManagementLogger
      Adds the log entry to the N last ephemeral logs and evicts the oldest one if the capacity is reached. The log entry contains both the message and cluster-related communication result associated with the message. Also, the method immediately logs the message to the Bamboo instance logs with the provided logger.
      Specified by:
      addEphemeralLogEntry in interface EphemeralAgentManagementLogger
      Parameters:
      logger - logger used to log the message to Bamboo logs
      message - information to keep
      clusterCommunicationResult - cluster communication result
      printSuccessfulResult - print successful messages to the logs
      logOnlyToEphemeralConsole - if true, the message will be logger to the Bamboo Ephemeral logs only, if false it will be logged on both Ephemeral and Bamboo instance logs
    • getEphemeralAgentLogs

      @NotNull public @NotNull List<EphemeralAgentManagementLogger.EphemeralAgentLog> getEphemeralAgentLogs()
      Description copied from interface: EphemeralAgentManagementLogger
      Return N last ephemeral agents related logs.
      Specified by:
      getEphemeralAgentLogs in interface EphemeralAgentManagementLogger
      Returns:
      list of formatted logs