39 namespace CloudWatchLogs {
43 const std::string & log_group,
44 const std::string & log_stream,
45 const Aws::Client::ClientConfiguration & client_config,
46 const Aws::SDKOptions & sdk_options,
49 Aws::InitAPI(sdk_options);
53 auto publisher = std::make_shared<LogPublisher>(log_group, log_stream, client_config);
56 std::make_shared<Aws::DataFlow::QueueMonitor<Aws::FileManagement::TaskPtr<LogCollection>>>();
63 auto log_file_upload_streamer =
64 Aws::FileManagement::createFileUploadStreamer<LogCollection>(log_file_manager, file_upload_options);
67 publisher->addPublisherStateListener([upload_streamer = log_file_upload_streamer](
const PublisherState& state) {
69 (state == PublisherState::CONNECTED) ? Aws::DataFlow::Status::AVAILABLE : Aws::DataFlow::Status::UNAVAILABLE;
70 upload_streamer->onPublisherStateChange(status);
74 auto file_data_queue =
79 auto log_batcher = std::make_shared<LogBatcher>(
83 log_batcher->setLogFileManager(log_file_manager);
85 log_file_upload_streamer->setSink(file_data_queue);
88 log_batcher->setSink(stream_data_queue);
91 auto log_service = std::make_shared<LogService>(publisher, log_batcher, log_file_upload_streamer);
92 log_service->setSource(queue_monitor);
Aws::DataFlow::UploaderOptions uploader_options
size_t batch_max_queue_size
virtual std::shared_ptr< LogService > CreateLogService(const std::string &log_group, const std::string &log_stream, const Aws::Client::ClientConfiguration &client_config, const Aws::SDKOptions &sdk_options, const CloudWatchOptions &cloudwatch_options=kDefaultCloudWatchOptions)
Creates a new LogService object Factory method used to create a new LogService object, along with a creating and starting a LogPublisher for use with the LogService.
size_t batch_trigger_publish_size
size_t file_upload_batch_size
Aws::FileManagement::FileManagerStrategyOptions file_manager_strategy_options
size_t stream_max_queue_size
Aws::DataFlow::ObservedBlockingQueue< TaskPtr< T >> TaskObservedBlockingQueue
size_t file_max_queue_size