Skip to content

Question: Possible to not miss logs without sleep? #9

@chrkau

Description

@chrkau

I'm pretty new to Rust so sorry if this should be obvious.

Looking at the example given in examples it calls tokio::time::sleep(Duration::from_secs(1)).await;. Now if I remove that line my loki instance will not receive a log. In my understanding that is because the background reporting thread is killed when the program exits - before it has a chance to deliver the log to loki.

So my question is: Is there a way to ensure all logs have been delivered before exiting the program? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions