#include <log_publisher.h>
Public Member Functions | |
LogPublisherRunState | getRunState () |
LogPublisher (const std::string &log_group, const std::string &log_stream, const Aws::Client::ClientConfiguration &client_config) | |
Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs. More... | |
LogPublisher (const std::string &log_group, const std::string &log_stream, std::shared_ptr< Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade > cw_client) | |
Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs. More... | |
LogPublisher (const LogPublisher &other)=delete | |
LogPublisher & | operator= (const LogPublisher &other)=delete |
bool | shutdown () override |
bool | start () override |
~LogPublisher () override | |
Tears down the LogPublisher object. More... | |
Public Member Functions inherited from Publisher< LogCollection > | |
virtual void | addPublisherStateListener (const std::function< void(const PublisherState &)> &listener) |
Aws::DataFlow::UploadStatus | attemptPublish (LogCollection &data) override |
bool | canPublish () |
std::chrono::milliseconds | getLastPublishDuration () |
int | getPublishAttempts () |
PublisherState | getPublisherState () |
int | getPublishSuccesses () |
float | getPublishSuccessPercentage () |
Publisher () | |
bool | shutdown () override |
~Publisher () override=default | |
Public Member Functions inherited from Aws::DataFlow::IPublisher< T > | |
virtual UploadStatus | attemptPublish (T &batch_data)=0 |
Public Member Functions inherited from Service | |
ServiceState | getState () |
virtual std::string | getStatusString () |
Service () | |
virtual | ~Service ()=default |
Private Member Functions | |
bool | checkIfConnected (Aws::CloudWatchLogs::ROSCloudWatchLogsErrors error) |
bool | configure () |
bool | CreateGroup () |
bool | CreateStream () |
bool | InitToken (Aws::String &next_token) |
Aws::DataFlow::UploadStatus | publishData (std::list< Aws::CloudWatchLogs::Model::InputLogEvent > &data) override |
void | resetInitToken () |
Aws::CloudWatchLogs::ROSCloudWatchLogsErrors | SendLogs (Aws::String &next_token, std::list< Aws::CloudWatchLogs::Model::InputLogEvent > &data) |
Private Attributes | |
Aws::SDKOptions | aws_sdk_options_ |
Aws::Client::ClientConfiguration | client_config_ |
std::shared_ptr< Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade > | cloudwatch_facade_ |
std::string | log_group_ |
std::string | log_stream_ |
std::recursive_mutex | mtx_ |
Aws::String | next_token |
Aws::SDKOptions | options_ |
ObservableObject< LogPublisherRunState > | run_state_ |
Additional Inherited Members | |
Protected Member Functions inherited from Publisher< LogCollection > | |
virtual Aws::DataFlow::UploadStatus | publishData (LogCollection &data)=0 |
Protected Member Functions inherited from Service | |
void | setState (ServiceState new_state) |
Wrapping class around the CloudWatch Logs API.
Definition at line 54 of file log_publisher.h.
Aws::CloudWatchLogs::LogPublisher::LogPublisher | ( | const std::string & | log_group, |
const std::string & | log_stream, | ||
const Aws::Client::ClientConfiguration & | client_config | ||
) |
Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs.
client_config | The ClientConfiguration that this publisher will use to create the Client. |
Definition at line 41 of file log_publisher.cpp.
Aws::CloudWatchLogs::LogPublisher::LogPublisher | ( | const std::string & | log_group, |
const std::string & | log_stream, | ||
std::shared_ptr< Aws::CloudWatchLogs::Utils::CloudWatchLogsFacade > | cw_client | ||
) |
Creates a LogPublisher object that uses the provided client and SDK configuration Constructs a LogPublisher object that will use the provided CloudWatchClient and SDKOptions when it publishes logs.
cw_client | The CloudWatchClient that this publisher will use when pushing logs to CloudWatch. |
Definition at line 54 of file log_publisher.cpp.
|
delete |
|
overridedefault |
Tears down the LogPublisher object.
|
private |
Check if the input status is related to a network failure.
error |
Definition at line 67 of file log_publisher.cpp.
|
private |
Definition at line 237 of file log_publisher.cpp.
|
private |
Checks to see if a log group already exists and tries to create it if not.
Definition at line 77 of file log_publisher.cpp.
|
private |
Checks to see if a log stream already exists and tries to create it if not.
Definition at line 124 of file log_publisher.cpp.
LogPublisherRunState Aws::CloudWatchLogs::LogPublisher::getRunState | ( | ) |
Definition at line 233 of file log_publisher.cpp.
|
private |
Fetches the token to use for writing logs to a stream.
Definition at line 162 of file log_publisher.cpp.
|
delete |
|
overrideprivate |
Definition at line 272 of file log_publisher.cpp.
|
private |
Reset the current init token to UNINITIALIZED_TOKEN
Definition at line 229 of file log_publisher.cpp.
|
private |
Definition at line 184 of file log_publisher.cpp.
|
overridevirtual |
Reimplemented from Service.
Definition at line 318 of file log_publisher.cpp.
|
overridevirtual |
Create the cloudwatch facade
Reimplemented from Service.
Definition at line 309 of file log_publisher.cpp.
|
private |
Definition at line 125 of file log_publisher.h.
|
private |
Definition at line 129 of file log_publisher.h.
|
private |
Definition at line 124 of file log_publisher.h.
|
private |
Definition at line 126 of file log_publisher.h.
|
private |
Definition at line 127 of file log_publisher.h.
|
mutableprivate |
Definition at line 133 of file log_publisher.h.
|
private |
Definition at line 132 of file log_publisher.h.
|
private |
Definition at line 128 of file log_publisher.h.
|
private |
Definition at line 131 of file log_publisher.h.