Crates.io | cloudwatch-log-redirector |
lib.rs | cloudwatch-log-redirector |
version | 0.1.6 |
source | src |
created_at | 2024-10-09 04:27:33.047207 |
updated_at | 2024-10-09 14:15:15.188907 |
description | Redirect STDERR/STDOUT to CloudWatch Logs |
homepage | |
repository | https://github.com/rustyconover/cloudwatch-log-redirector |
max_upload_size | |
id | 1401992 |
size | 64,361 |
Welcome to the CloudWatch Log Redirector! This handy command-line tool helps you capture the logs from your applications and redirect them to AWS CloudWatch Logs.
CloudWatch Logs is a fantastic service for storing application logs, especially in environments like Docker or ECS containers. In these scenarios, local storage is often unavailable, making CloudWatch an ideal solution for log management. However, there are times when you want to capture logs from specific applications running alongside others within the same container or environment. That's where the CloudWatch Log Redirector comes in!
[STDOUT]
and [STDERR]
.--tee
option to view logs in real time while they are sent to CloudWatch.Getting started is simple! Here’s how to use the CloudWatch Log Redirector:
Usage: cloudwatch-log-redirector [OPTIONS] <LOG_GROUP_NAME> <LOG_STREAM_NAME> <COMMAND> [ARGS]...
Arguments:
<LOG_GROUP_NAME> The name of the CloudWatch Logs log group.
<LOG_STREAM_NAME> The name of the CloudWatch Logs log stream.
<COMMAND> The command to execute.
[ARGS]... Additional arguments for the command.
Options:
-t, --tag-stream-names Tag the stream names with [STDOUT] and [STDERR].
--tee Display output in real time while sending it to CloudWatch Logs.
-h, --help Show this help message.
-V, --version Display the current version of the tool.
Here’s a quick example of how to use the tool:
cloudwatch-log-redirector \
my-log-group \
my-log-stream \
command arg1 arg2
Here is a very simple that likely isn't very useful.
cloudwatch-log-redirector \
my-log-group \
my-log-stream \
ls -lR
The CloudWatch Log Redirector is built with Tokio, allowing it to efficiently manage subprocesses. When you run a command, the tool does the following:
Need more assistance? Just run:
cloudwatch-log-redirector --help
to view the available options and usage instructions.