public AWSLogger(string i_OrgId, string i_OrgType, string i_InstanceName, string i_Environment, string i_Operation, string i_Product, string i_Feature) { m_Product = i_Product; m_Feature = i_Feature; m_BasicLogInput = new LogInput(i_OrgId, i_OrgType, i_InstanceName, i_Environment, i_Operation, i_Product, i_Feature); m_shouldInitializeClient = shouldInitializeFirehoseClient(); updateAmazonKinesisFirehoseClient(); m_InputsToSend = new List <LogInput>(); }
private static Record createRecord(LogInput i_Input) { string data = i_Input.ToString(); Record record = new Record() { Data = generateMemoryStreamFromString(data) }; return(record); }
public void AddDataToSend(string i_Context, string i_Message, int i_Count, double i_DurationInSeconds, string i_Details, LogLevel i_Level = LogLevel.Information) { if (m_BasicLogInput != null) { LogInput dataToSend = (LogInput)m_BasicLogInput.Clone(); dataToSend.Count = i_Count; dataToSend.Duration = i_DurationInSeconds; dataToSend.Details = i_Details; addDataToSendList(dataToSend, i_Context, i_Message, i_Level); } }
private void addDataToSendList(LogInput i_Data, string i_Context, string i_Message, LogLevel i_Level) { try { i_Data.Context = i_Context; i_Data.Message = i_Message; i_Data.Level = i_Level; m_InputsToSend.Add(i_Data); } catch (Exception ex) { m_logger.LogError(string.Format("Failed to add monitoring statistics\n{0}", LogUtils.GetExceptionDetails(ex))); //m_logger.LogError(ex.Message); } }