Skip to content

How do I push log events to CloudWatchLogs? #598

Answered by rnhurt
rnhurt asked this question in Q&A
Discussion options

You must be logged in to vote

Just to provide an answer for future me; I found out how the "builder" pattern works.

This code will create an "event" which you can feed to the "put_log_events" call:

    let time = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
    let event = InputLogEvent::builder()
        .timestamp(time.as_micros().try_into().unwrap())
        .message(String::from("this is a test message"))
        .build();

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rnhurt
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants