dotnet / Docker.DotNet

:whale: .NET (C#) Client Library for Docker API
https://www.nuget.org/packages/Docker.DotNet/
MIT License
2.23k stars 381 forks source link

I need to get logs last 10 min in c# #634

Open kurubavinodkumar opened 1 year ago

kurubavinodkumar commented 1 year ago

I need to get log last 10 min . I am not able to find a solution

example : var parameters = new ContainerLogsParameters { ShowStdout = true, ShowStderr = true, Timestamps = true, Since = "1" };

Stream logStream = await (client.Containers.GetContainerLogsAsync(container.ID, parameters, default)).ConfigureAwait(false);

in above example what should I pass since value

HofmeisterAn commented 1 year ago

The since and until parameter receives a UNIX timestamp. Here is an example. The count starts at the Unix Epoch.