Class CloudWatchLogsClient

java.lang.Object
codes.grow.packages.cloudwatchlogs.CloudWatchLogsClient
All Implemented Interfaces:
AutoCloseable

public final class CloudWatchLogsClient extends Object implements AutoCloseable
Client for Amazon CloudWatch Logs, built on the official AWS SDK for Java v2 (SPEC section 2.3 "Cloud SDK services").

Thread-safe; create one per configuration and close it when done. Every I/O method has a blocking form and an …Async form returning CompletableFuture; cancelling the future aborts the call. Paginated listings return a lazy Iterable (blocking) or the collected list (async).


 try (CloudWatchLogsClient client = CloudWatchLogsClient.fromEnv()) {
   client.ensureLogGroup("my-app/api", EnsureLogGroupOptions.builder().retentionDays(7).build());
   client.putLogEvents("my-app/api", "web-1", List.of(LogEvent.of("hello")));
 }