Class EphemeralAgentManagementLoggerImpl
java.lang.Object
com.atlassian.bamboo.agent.ephemeral.logging.EphemeralAgentManagementLoggerImpl
- All Implemented Interfaces:
EphemeralAgentManagementLogger
public class EphemeralAgentManagementLoggerImpl
extends Object
implements EphemeralAgentManagementLogger
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.agent.ephemeral.logging.EphemeralAgentManagementLogger
EphemeralAgentManagementLogger.EphemeralAgentLog
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEphemeralLogEntry
(@NotNull org.apache.logging.log4j.Logger logger, @NotNull String message, boolean isSuccessfulMessage) Adds the log entry to the N last ephemeral logs and evicts the oldest one if the capacity is reached.void
addEphemeralLogEntry
(@NotNull org.apache.logging.log4j.Logger logger, @NotNull String message, @NotNull AgentMaintenanceResult clusterCommunicationResult) Adds the log entry to the N last ephemeral logs and evicts the oldest one if the capacity is reached.void
addEphemeralLogEntry
(@NotNull org.apache.logging.log4j.Logger logger, @NotNull String message, @NotNull AgentMaintenanceResult clusterCommunicationResult, boolean printSuccessfulResult, boolean logOnlyToEphemeralConsole) Adds the log entry to the N last ephemeral logs and evicts the oldest one if the capacity is reached.Return N last ephemeral agents related logs.
-
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 interfaceEphemeralAgentManagementLogger
- Parameters:
logger
- logger used to log the message to Bamboo logsmessage
- information to keepisSuccessfulMessage
- 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, useEphemeralAgentManagementLogger.addEphemeralLogEntry(Logger, String, AgentMaintenanceResult, boolean, boolean)
with printSuccessfulResult and logOnlyToEphemeralLogger set to true- Specified by:
addEphemeralLogEntry
in interfaceEphemeralAgentManagementLogger
- Parameters:
logger
- logger used to log the message to Bamboo logsmessage
- information to keepclusterCommunicationResult
- 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 interfaceEphemeralAgentManagementLogger
- Parameters:
logger
- logger used to log the message to Bamboo logsmessage
- information to keepclusterCommunicationResult
- cluster communication resultprintSuccessfulResult
- print successful messages to the logslogOnlyToEphemeralConsole
- 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 interfaceEphemeralAgentManagementLogger
- Returns:
- list of formatted logs
-