Class CloudWatchLogsClient
java.lang.Object
codes.grow.packages.cloudwatchlogs.CloudWatchLogsClient
- All Implemented Interfaces:
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")));
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder that configures and creates a client in one chain. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCloudWatch Logs API version (2014-03-28).AllowedretentionDaysvalues. -
Method Summary
Modifier and TypeMethodDescriptionstatic CloudWatchLogsClient.Builderbuilder()Starts a client builder.voidclose()Flushes and closes every log client created bylogClient(codes.grow.packages.cloudwatchlogs.CloudWatchLogClientOptions), stops live-tail sessions and releases connections.config()Returns the configuration.static CloudWatchLogsClientcreate(CloudWatchLogsConfig config) Creates a client.booleandeleteLogGroup(String name) deleteLogGroup(String, boolean)that raisesNotFoundExceptionwhen missing.booleandeleteLogGroup(String name, boolean ignoreMissing) Deletes a log group with its streams and events.deleteLogGroupAsync(String name, boolean ignoreMissing) AsynchronousdeleteLogGroup(String, boolean).booleandeleteLogStream(String group, String stream) deleteLogStream(String, String, boolean)that raisesNotFoundExceptionwhen missing.booleandeleteLogStream(String group, String stream, boolean ignoreMissing) Deletes a log stream.deleteLogStreamAsync(String group, String stream, boolean ignoreMissing) AsynchronousdeleteLogStream(String, String, boolean).Iterates log groups (sorted by name) across pages, lazily.AsynchronousdescribeLogGroups(DescribeLogGroupsOptions): collects every group (up tolimit).describeLogStreams(String group) describeLogStreams(String, DescribeLogStreamsOptions)with default options.describeLogStreams(String group, DescribeLogStreamsOptions options) Iterates the log streams of a group across pages, lazily.describeLogStreamsAsync(String group, DescribeLogStreamsOptions options) AsynchronousdescribeLogStreams(String, DescribeLogStreamsOptions): collects every stream (up tolimit).describeQueries(DescribeQueriesOptions options) Lists recent Logs Insights queries (DescribeQueries).AsynchronousdescribeQueries(DescribeQueriesOptions).Builds an Embedded Metric Format document (Emf.build(java.lang.String, double, java.util.Map<java.lang.String, java.lang.String>, codes.grow.packages.cloudwatchlogs.Emf.Options)) and sends it as one log event tooptions.group/options.stream(defaultsconfig.logGroup/config.logStream).Asynchronousemf(String, double, Map, Emf.Options).ensureLogGroup(String name) ensureLogGroup(String, EnsureLogGroupOptions)with default options.ensureLogGroup(String name, EnsureLogGroupOptions options) Creates the log group when it is missing (CreateLogGroup), then applies retention and tags.ensureLogGroupAsync(String name, EnsureLogGroupOptions options) AsynchronousensureLogGroup(String, EnsureLogGroupOptions).ensureLogStream(String group, String stream) ensureLogStream(String, String, boolean)without creating the group.ensureLogStream(String group, String stream, boolean createGroup) Creates the log stream when it is missing (CreateLogStream).ensureLogStreamAsync(String group, String stream, boolean createGroup) AsynchronousensureLogStream(String, String, boolean).Returns an exporter that writes records withPutLogEvents.filterLogEvents(FilterLogEventsOptions options) Iterates events matching a filter pattern (FilterLogEvents) across pages, lazily, until no token is left (orlimit).AsynchronousfilterLogEvents(FilterLogEventsOptions): collects every event (up tolimit).filterLogEventsPage(FilterLogEventsOptions options, String nextToken) OneFilterLogEventsrequest.filterLogEventsPageAsync(FilterLogEventsOptions options, String nextToken) AsynchronousfilterLogEventsPage(FilterLogEventsOptions, String).static CloudWatchLogsClientfromEnv()Creates a client fromGROW_AWS_CLOUDWATCH_LOGS_*and the standard AWS variables.getLogEvents(String group, String stream, GetLogEventsOptions options) Iterates the events of one stream (GetLogEvents), lazily.getLogEventsAsync(String group, String stream, GetLogEventsOptions options) AsynchronousgetLogEvents(String, String, GetLogEventsOptions): collects every event (up tolimit).getLogGroup(String name) Finds a log group by exact name (DescribeLogGroupswith the name as prefix).getLogGroupAsync(String name) AsynchronousgetLogGroup(String).getQueryResults(String queryId) Reads the status and rows of a Logs Insights query (GetQueryResults).getQueryResultsAsync(String queryId) AsynchronousgetQueryResults(String).health()Liveness via a signedDescribeLogGroups {limit: 1}without retries.Asynchronoushealth().booleanisClosed()Returns whetherclose()was called.listLogGroupTags(String group) Returns the tags of a log group (ListTagsForResource).listLogGroupTagsAsync(String group) AsynchronouslistLogGroupTags(String).logClient(CloudWatchLogClientOptions)with default options.logClient(CloudWatchLogClientOptions options) Returns aBatchingLogClientthat exports to the group/stream ofoptions(defaultsconfig.logGroup/config.logStream; the stream is created on first use).logGroupArn(String group) Returns the ARN of a log group (without:*): built fromconfig.accountIdand the region when the account is configured, otherwise looked up withDescribeLogGroups.logGroupArnAsync(String group) AsynchronouslogGroupArn(String).Returns a query client overconfig.logGroup.logQueryClient(String group) Returns a query client overgroup.parseInsightsTimestamp(String value) Converts a Logs Insights@timestamp(YYYY-MM-DD HH:mm:ss.SSSUTC on AWS, epoch milliseconds on Moto) to an instant.static StringpartitionForRegion(String region) Returns the partition of a region (aws,aws-cn,aws-us-gov, …).ping()Authenticated round trip (DescribeLogGroups {limit: 1}).Asynchronousping().putLogEvents(String group, String stream, List<LogEvent> events) putLogEvents(String, String, List, PutLogEventsOptions)with default options.putLogEvents(String group, String stream, List<LogEvent> events, PutLogEventsOptions options) Sends events withPutLogEvents.putLogEventsAsync(String group, String stream, List<LogEvent> events, PutLogEventsOptions options) AsynchronousputLogEvents(String, String, List, PutLogEventsOptions).voidputRetentionPolicy(String group, int days) Sets the retention (PutRetentionPolicy);0removes it (DeleteRetentionPolicy, never expire).putRetentionPolicyAsync(String group, int days) AsynchronousputRetentionPolicy(String, int).query(String queryString, QueryOptions options) Runs a Logs Insights query to completion:StartQuery, then pollsGetQueryResultsuntil a terminal status.queryAsync(String queryString, QueryOptions options) Asynchronousquery(String, QueryOptions).region()Returns the resolved AWS region.software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsAsyncClientsdk()Returns the underlying AWS SDK client (for operations this package does not wrap).Always throwsUnsupportedException: CloudWatch Logs exposes no server version (seeAPI_VERSION).AsynchronousserverVersion()(always fails withUnsupportedException).startLiveTail(LiveTailRequest request, Consumer<LiveTailEvent> onEvent) startLiveTail(LiveTailRequest, Consumer, LiveTailOptions)without callbacks.startLiveTail(LiveTailRequest request, Consumer<LiveTailEvent> onEvent, LiveTailOptions options) Starts a Live Tail session (StartLiveTail) and callsonEventfor every event.startLiveTailAsync(LiveTailRequest request, Consumer<LiveTailEvent> onEvent, LiveTailOptions options) AsynchronousstartLiveTail(LiveTailRequest, Consumer, LiveTailOptions): completes once the session has started.startQuery(String queryString, QueryOptions options) Starts a Logs Insights query (StartQuery).startQueryAsync(String queryString, QueryOptions options) AsynchronousstartQuery(String, QueryOptions).booleanStops a running query (StopQuery).stopQueryAsync(String queryId) AsynchronousstopQuery(String).static <T> Stream<T> Wraps an iterable in a sequential stream.voidtagLogGroup(String group, Map<String, String> tags) Adds or overwrites tags of a log group (TagResource).tagLogGroupAsync(String group, Map<String, String> tags) AsynchronoustagLogGroup(String, Map).toString()voiduntagLogGroup(String group, List<String> keys) Removes tags from a log group (UntagResource).untagLogGroupAsync(String group, List<String> keys) AsynchronousuntagLogGroup(String, List).
-
Field Details
-
RETENTION_DAYS
AllowedretentionDaysvalues. -
API_VERSION
CloudWatch Logs API version (2014-03-28).- See Also:
-
-
Method Details
-
create
Creates a client.- Parameters:
config- validated configuration- Returns:
- a new client
- Throws:
ConfigException- when the configuration is invalid or no region can be resolved
-
fromEnv
Creates a client fromGROW_AWS_CLOUDWATCH_LOGS_*and the standard AWS variables.- Returns:
- a new client
-
builder
Starts a client builder.- Returns:
- a new builder
-
config
Returns the configuration.- Returns:
- the configuration
-
sdk
public software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsAsyncClient sdk()Returns the underlying AWS SDK client (for operations this package does not wrap).- Returns:
- the SDK client
-
region
Returns the resolved AWS region.- Returns:
- the region id, e.g.
us-east-1
-
isClosed
public boolean isClosed()Returns whetherclose()was called.- Returns:
- true once closed
-
parseInsightsTimestamp
Converts a Logs Insights@timestamp(YYYY-MM-DD HH:mm:ss.SSSUTC on AWS, epoch milliseconds on Moto) to an instant.- Parameters:
value- the field value- Returns:
- the instant, or empty when the text is neither form
-
partitionForRegion
Returns the partition of a region (aws,aws-cn,aws-us-gov, …).- Parameters:
region- region id- Returns:
- the partition
-
stream
Wraps an iterable in a sequential stream.- Type Parameters:
T- item type- Parameters:
iterable- the iterable- Returns:
- the stream
-
health
Liveness via a signedDescribeLogGroups {limit: 1}without retries. Never throws for an unhealthy or unreachable service. The service answering with an authentication or permission error still counts as healthy (details.auth = "failed"); throttling reportsdegraded.- Returns:
- the health status
- Throws:
CancelledException- when interrupted or closed
-
healthAsync
Asynchronoushealth().- Returns:
- a future with the health status
-
ping
Authenticated round trip (DescribeLogGroups {limit: 1}).- Returns:
- the latency
- Throws:
AuthenticationException- on bad credentialsPermissionDeniedException- withoutlogs:DescribeLogGroups
-
pingAsync
Asynchronousping().- Returns:
- a future with the latency
-
serverVersion
Always throwsUnsupportedException: CloudWatch Logs exposes no server version (seeAPI_VERSION).- Returns:
- never returns
- Throws:
UnsupportedException- always
-
serverVersionAsync
AsynchronousserverVersion()(always fails withUnsupportedException).- Returns:
- a failed future
-
close
public void close()Flushes and closes every log client created bylogClient(codes.grow.packages.cloudwatchlogs.CloudWatchLogClientOptions), stops live-tail sessions and releases connections. Idempotent; never closes a caller-supplied SDK client. Later calls fail withCancelledException.- Specified by:
closein interfaceAutoCloseable
-
getLogGroup
Finds a log group by exact name (DescribeLogGroupswith the name as prefix).- Parameters:
name- group name- Returns:
- the group, or empty
-
getLogGroupAsync
AsynchronousgetLogGroup(String).- Parameters:
name- group name- Returns:
- a future with the group, or empty
-
ensureLogGroup
Creates the log group when it is missing (CreateLogGroup), then applies retention and tags. For an existing group the requested tags are added (never removed) and the retention is re-applied; a different KMS key raisesConflictException.- Parameters:
name- group nameoptions- retention, KMS key, tags- Returns:
- whether the group was created, and its ARN
-
ensureLogGroup
ensureLogGroup(String, EnsureLogGroupOptions)with default options.- Parameters:
name- group name- Returns:
- whether the group was created, and its ARN
-
ensureLogGroupAsync
public CompletableFuture<EnsureLogGroupResult> ensureLogGroupAsync(String name, EnsureLogGroupOptions options) AsynchronousensureLogGroup(String, EnsureLogGroupOptions).- Parameters:
name- group nameoptions- retention, KMS key, tags- Returns:
- a future with the result
-
ensureLogStream
Creates the log stream when it is missing (CreateLogStream).- Parameters:
group- group namestream- stream namecreateGroup- create the log group first when it is missing- Returns:
- whether the stream was created
- Throws:
NotFoundException- when the group is missing andcreateGroupis false
-
ensureLogStream
ensureLogStream(String, String, boolean)without creating the group.- Parameters:
group- group namestream- stream name- Returns:
- whether the stream was created
-
ensureLogStreamAsync
public CompletableFuture<EnsureLogStreamResult> ensureLogStreamAsync(String group, String stream, boolean createGroup) AsynchronousensureLogStream(String, String, boolean).- Parameters:
group- group namestream- stream namecreateGroup- create the log group first when it is missing- Returns:
- a future with the result
-
putRetentionPolicy
Sets the retention (PutRetentionPolicy);0removes it (DeleteRetentionPolicy, never expire).- Parameters:
group- group namedays- one ofRETENTION_DAYS, or 0
-
putRetentionPolicyAsync
AsynchronousputRetentionPolicy(String, int).- Parameters:
group- group namedays- one ofRETENTION_DAYS, or 0- Returns:
- a future that completes when done
-
deleteLogGroup
Deletes a log group with its streams and events.- Parameters:
name- group nameignoreMissing- return false instead of raisingNotFoundException- Returns:
- true when deleted, false when missing and
ignoreMissing
-
deleteLogGroup
deleteLogGroup(String, boolean)that raisesNotFoundExceptionwhen missing.- Parameters:
name- group name- Returns:
- true
-
deleteLogGroupAsync
AsynchronousdeleteLogGroup(String, boolean).- Parameters:
name- group nameignoreMissing- return false instead of raisingNotFoundException- Returns:
- a future with the result
-
deleteLogStream
Deletes a log stream.- Parameters:
group- group namestream- stream nameignoreMissing- return false instead of raisingNotFoundException- Returns:
- true when deleted, false when missing and
ignoreMissing
-
deleteLogStream
deleteLogStream(String, String, boolean)that raisesNotFoundExceptionwhen missing.- Parameters:
group- group namestream- stream name- Returns:
- true
-
deleteLogStreamAsync
public CompletableFuture<Boolean> deleteLogStreamAsync(String group, String stream, boolean ignoreMissing) AsynchronousdeleteLogStream(String, String, boolean).- Parameters:
group- group namestream- stream nameignoreMissing- return false instead of raisingNotFoundException- Returns:
- a future with the result
-
describeLogGroups
Iterates log groups (sorted by name) across pages, lazily.- Parameters:
options- prefix, page size, limit- Returns:
- the groups
-
describeLogGroupsAsync
public CompletableFuture<List<LogGroupInfo>> describeLogGroupsAsync(DescribeLogGroupsOptions options) AsynchronousdescribeLogGroups(DescribeLogGroupsOptions): collects every group (up tolimit).- Parameters:
options- prefix, page size, limit- Returns:
- a future with the groups
-
describeLogStreams
Iterates the log streams of a group across pages, lazily.- Parameters:
group- group nameoptions- prefix, order, page size, limit- Returns:
- the streams
-
describeLogStreams
describeLogStreams(String, DescribeLogStreamsOptions)with default options.- Parameters:
group- group name- Returns:
- the streams
-
describeLogStreamsAsync
public CompletableFuture<List<LogStreamInfo>> describeLogStreamsAsync(String group, DescribeLogStreamsOptions options) AsynchronousdescribeLogStreams(String, DescribeLogStreamsOptions): collects every stream (up tolimit).- Parameters:
group- group nameoptions- prefix, order, page size, limit- Returns:
- a future with the streams
-
tagLogGroup
Adds or overwrites tags of a log group (TagResource).- Parameters:
group- group name or ARNtags- tags
-
tagLogGroupAsync
AsynchronoustagLogGroup(String, Map).- Parameters:
group- group name or ARNtags- tags- Returns:
- a future that completes when done
-
untagLogGroup
Removes tags from a log group (UntagResource).- Parameters:
group- group name or ARNkeys- tag keys
-
untagLogGroupAsync
AsynchronousuntagLogGroup(String, List).- Parameters:
group- group name or ARNkeys- tag keys- Returns:
- a future that completes when done
-
listLogGroupTags
Returns the tags of a log group (ListTagsForResource).- Parameters:
group- group name or ARN- Returns:
- the tags
-
listLogGroupTagsAsync
AsynchronouslistLogGroupTags(String).- Parameters:
group- group name or ARN- Returns:
- a future with the tags
-
putLogEvents
public PutLogEventsResult putLogEvents(String group, String stream, List<LogEvent> events, PutLogEventsOptions options) Sends events withPutLogEvents. Events are sorted, oversized events are truncated / dropped / rejected peroversizePolicy, and the events are split into batches that respect every service limit (10 000 events, 1 MiB incl. 26 bytes per event, 24 h span). A missing stream is created whenautoCreateis on. Events the service rejects (too old, too new, expired) are reported, never retried. Throttling and 5xx are retried by the AWS SDK (a lost response may duplicate events).- Parameters:
group- group namestream- stream nameevents- events in any orderoptions- auto-create and size policy- Returns:
- accepted, rejected, truncated and dropped counts
-
putLogEvents
putLogEvents(String, String, List, PutLogEventsOptions)with default options.- Parameters:
group- group namestream- stream nameevents- events in any order- Returns:
- the result
-
putLogEventsAsync
public CompletableFuture<PutLogEventsResult> putLogEventsAsync(String group, String stream, List<LogEvent> events, PutLogEventsOptions options) AsynchronousputLogEvents(String, String, List, PutLogEventsOptions).- Parameters:
group- group namestream- stream nameevents- events in any orderoptions- auto-create and size policy- Returns:
- a future with the result
-
emf
public Map<String,Object> emf(String metric, double value, Map<String, String> dimensions, Emf.Options options) Builds an Embedded Metric Format document (Emf.build(java.lang.String, double, java.util.Map<java.lang.String, java.lang.String>, codes.grow.packages.cloudwatchlogs.Emf.Options)) and sends it as one log event tooptions.group/options.stream(defaultsconfig.logGroup/config.logStream).- Parameters:
metric- metric namevalue- metric valuedimensions- dimensions (at most 30)options- namespace, unit, timestamp, properties, target- Returns:
- the document sent
-
emfAsync
public CompletableFuture<Map<String,Object>> emfAsync(String metric, double value, Map<String, String> dimensions, Emf.Options options) Asynchronousemf(String, double, Map, Emf.Options).- Parameters:
metric- metric namevalue- metric valuedimensions- dimensions (at most 30)options- namespace, unit, timestamp, properties, target- Returns:
- a future with the document sent
-
filterLogEventsPage
OneFilterLogEventsrequest. Events are ordered by timestamp, then event id.- Parameters:
options- group, streams, pattern, range, page sizenextToken- token of the previous page, or null- Returns:
- the page
-
filterLogEventsPageAsync
public CompletableFuture<FilterLogEventsPage> filterLogEventsPageAsync(FilterLogEventsOptions options, String nextToken) AsynchronousfilterLogEventsPage(FilterLogEventsOptions, String).- Parameters:
options- group, streams, pattern, range, page sizenextToken- token of the previous page, or null- Returns:
- a future with the page
-
filterLogEvents
Iterates events matching a filter pattern (FilterLogEvents) across pages, lazily, until no token is left (orlimit). Within a page events are ordered by timestamp, then event id.- Parameters:
options- group, streams, pattern, range, page size, limit- Returns:
- the events
-
filterLogEventsAsync
public CompletableFuture<List<FilteredLogEvent>> filterLogEventsAsync(FilterLogEventsOptions options) AsynchronousfilterLogEvents(FilterLogEventsOptions): collects every event (up tolimit).- Parameters:
options- group, streams, pattern, range, page size, limit- Returns:
- a future with the events
-
getLogEvents
public Iterable<StreamLogEvent> getLogEvents(String group, String stream, GetLogEventsOptions options) Iterates the events of one stream (GetLogEvents), lazily.startFromHeadreads oldest to newest (forward tokens); the default reads the newest page first and then older pages (backward tokens; events inside a page stay ascending). Iteration stops when the service returns the token that was sent.- Parameters:
group- group namestream- stream nameoptions- direction, range, page size, limit- Returns:
- the events
-
getLogEventsAsync
public CompletableFuture<List<StreamLogEvent>> getLogEventsAsync(String group, String stream, GetLogEventsOptions options) AsynchronousgetLogEvents(String, String, GetLogEventsOptions): collects every event (up tolimit).- Parameters:
group- group namestream- stream nameoptions- direction, range, page size, limit- Returns:
- a future with the events
-
startQuery
Starts a Logs Insights query (StartQuery).- Parameters:
queryString- Logs Insights queryoptions- groups, range, limit- Returns:
- the query id
-
startQueryAsync
AsynchronousstartQuery(String, QueryOptions).- Parameters:
queryString- Logs Insights queryoptions- groups, range, limit- Returns:
- a future with the query id
-
getQueryResults
Reads the status and rows of a Logs Insights query (GetQueryResults).- Parameters:
queryId- query id- Returns:
- status, rows and statistics
-
getQueryResultsAsync
AsynchronousgetQueryResults(String).- Parameters:
queryId- query id- Returns:
- a future with the results
-
stopQuery
Stops a running query (StopQuery).- Parameters:
queryId- query id- Returns:
- false when it had already finished
-
stopQueryAsync
AsynchronousstopQuery(String).- Parameters:
queryId- query id- Returns:
- a future with the result
-
query
Runs a Logs Insights query to completion:StartQuery, then pollsGetQueryResultsuntil a terminal status.Failed/UnknownraiseUnavailableException,TimeoutTimeoutException,CancelledCancelledException(the message includes the query id). Whentimeoutpasses or the returned future is cancelled, the query is stopped best-effort.- Parameters:
queryString- Logs Insights queryoptions- groups, range, limit, timeout, poll interval- Returns:
- the completed results
-
queryAsync
Asynchronousquery(String, QueryOptions).- Parameters:
queryString- Logs Insights queryoptions- groups, range, limit, timeout, poll interval- Returns:
- a future with the completed results
-
describeQueries
Lists recent Logs Insights queries (DescribeQueries).- Parameters:
options- group, status, max results- Returns:
- the queries
-
describeQueriesAsync
AsynchronousdescribeQueries(DescribeQueriesOptions).- Parameters:
options- group, status, max results- Returns:
- a future with the queries
-
logGroupArn
Returns the ARN of a log group (without:*): built fromconfig.accountIdand the region when the account is configured, otherwise looked up withDescribeLogGroups. An ARN is returned without:*.- Parameters:
group- group name or ARN- Returns:
- the ARN
-
logGroupArnAsync
AsynchronouslogGroupArn(String).- Parameters:
group- group name or ARN- Returns:
- a future with the ARN
-
startLiveTail
public LiveTailHandle startLiveTail(LiveTailRequest request, Consumer<LiveTailEvent> onEvent, LiveTailOptions options) Starts a Live Tail session (StartLiveTail) and callsonEventfor every event. Returns once the session has started (sessionStart), with a handle to stop it. On AWS the session streams new events for up to 3 hours; the Moto emulator replays matching existing events once and ends. Callbacks run on SDK threads and must not block.- Parameters:
request- groups, streams, patternonEvent- called for every eventoptions- error and update callbacks- Returns:
- the session handle
-
startLiveTail
startLiveTail(LiveTailRequest, Consumer, LiveTailOptions)without callbacks.- Parameters:
request- groups, streams, patternonEvent- called for every event- Returns:
- the session handle
-
startLiveTailAsync
public CompletableFuture<LiveTailHandle> startLiveTailAsync(LiveTailRequest request, Consumer<LiveTailEvent> onEvent, LiveTailOptions options) AsynchronousstartLiveTail(LiveTailRequest, Consumer, LiveTailOptions): completes once the session has started.- Parameters:
request- groups, streams, patternonEvent- called for every eventoptions- error and update callbacks- Returns:
- a future with the session handle
-
logClient
Returns aBatchingLogClientthat exports to the group/stream ofoptions(defaultsconfig.logGroup/config.logStream; the stream is created on first use). Records are sent as normalized LogRecord JSON.close()flushes it too.- Parameters:
options- target, batching, resource, redaction- Returns:
- the log client
-
logClient
logClient(CloudWatchLogClientOptions)with default options.- Returns:
- the log client
-
exporter
Returns an exporter that writes records withPutLogEvents.- Parameters:
group- log group (null:config.logGroup)stream- log stream (null:config.logStream)createGroup- create a missing log group on the first export- Returns:
- the exporter
-
logQueryClient
Returns a query client overgroup.- Parameters:
group- log group (null:config.logGroup)- Returns:
- the query client
-
logQueryClient
Returns a query client overconfig.logGroup.- Returns:
- the query client
-
toString
-