#include <log_service.h>
Public Member Functions | |
Aws::CloudWatchLogs::Model::InputLogEvent | convertInputToBatched (const std::string &input, const std::chrono::milliseconds &milliseconds) override |
Aws::CloudWatchLogs::Model::InputLogEvent | convertInputToBatched (const std::string &input) override |
LogService (std::shared_ptr< Publisher< LogCollection >> log_publisher, std::shared_ptr< DataBatcher< LogType >> log_batcher, std::shared_ptr< Aws::FileManagement::FileUploadStreamer< LogCollection >> log_file_upload_streamer=nullptr) | |
Public Member Functions inherited from Aws::CloudWatch::CloudWatchService< std::string, LogType > | |
virtual bool | batchData (const D &data_to_batch) |
virtual bool | batchData (const D &data_to_batch, const std::chrono::milliseconds &milliseconds) |
CloudWatchService (std::shared_ptr< Publisher< std::list< T >>> publisher, std::shared_ptr< DataBatcher< T >> batcher) | |
virtual std::chrono::milliseconds | getCurrentTimestamp () |
virtual std::chrono::milliseconds | getDequeueDuration () |
int | getNumberDequeued () |
virtual bool | isConnected () |
virtual bool | publishBatchedData () |
virtual bool | setDequeueDuration (std::chrono::milliseconds new_value) |
virtual bool | shutdown () |
virtual bool | start () override |
~CloudWatchService ()=default | |
Public Member Functions inherited from InputStage< TaskPtr< std::list< T > > > | |
std::shared_ptr< Source< TaskPtr< std::list< T > > > > | getSource () |
void | setSource (std::shared_ptr< Source< TaskPtr< std::list< T > > >> source) |
Public Member Functions inherited from RunnableService | |
std::string | getStatusString () override |
virtual bool | isRunning () |
void | join () |
RunnableService () | |
void | waitForShutdown (std::chrono::milliseconds millis) |
void | waitForShutdown () |
~RunnableService () override=default | |
Public Member Functions inherited from Service | |
ServiceState | getState () |
Service () | |
virtual | ~Service ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from Aws::CloudWatch::CloudWatchService< std::string, LogType > | |
virtual T | convertInputToBatched (const D &input, const std::chrono::milliseconds &milliseconds)=0 |
virtual T | convertInputToBatched (const D &input)=0 |
void | work () |
Protected Member Functions inherited from RunnableService | |
virtual void | run () |
virtual bool | startWorkerThread () |
virtual bool | stopWorkerThread () |
Protected Member Functions inherited from Service | |
void | setState (ServiceState new_state) |
Protected Attributes inherited from Aws::CloudWatch::CloudWatchService< std::string, LogType > | |
std::shared_ptr< DataBatcher< T > > | batcher_ |
std::chrono::milliseconds | dequeue_duration_ |
std::shared_ptr< FileUploadStreamer< std::list< T > > > | file_upload_streamer_ |
std::shared_ptr< Publisher< std::list< T > > > | publisher_ |
Implementation to send logs to Cloudwatch. Note: though the batcher and publisher are required, the file streamer is not. If the file streamer is not provided then log data is dropped if any failure is observed during the attempt to publish.
Definition at line 45 of file log_service.h.
|
inline |
Construct a new instance of LogService.
publisher | used to publish logs to CloudWatch |
batcher | used to batch / queue logs before publishing |
file_upload_streamer | used to save logs data and upload later in the event of network connectivity changes |
Definition at line 55 of file log_service.h.
|
inlineoverride |
Convert an input string and timestamp to a log event.
input | string input to be sent as a log |
milliseconds | timestamp of the log event |
Definition at line 70 of file log_service.h.
|
inlineoverride |
Convert an input string to a log event. The current system time is used as the log event timestamp.
input | string input to be sent as a log |
Definition at line 88 of file log_service.h.