You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use this package with my project, but failed. Unfortunately many function working in my project with troubles. This is my code to read docker container logs.
Function ReadContainerLog(DockerHub As DockerClient, ContainerID As String, Readlog As Action(Of String), LogsCts As CancellationToken) As Task
Dim ContainerLogsTask As Task = DockerHub.Containers.GetContainerLogsAsync(
ContainerID,
New ContainerLogsParameters With {
.ShowStderr = True,
.ShowStdout = True,
.Timestamps = True,
.Follow = True
},
LogsCts,
New Progress(Of String)(Readlog)
)
Return ContainerLogsTask
End Function
Module Program
Sub Main(args As String())
Dim LogCtsSrc As New CancellationTokenSource()
Dim ContainerLogs As New List(Of String)
Public Sub ReadLog(Line As String)
If LogCtsSrc.IsCancellationRequested Then Exit Sub
ContainerLogs.Add(Line)
End Sub
...
ReadContainerLog(DockerHub, ContainerId, AddressOf ReadLog, LogCtsSrc.Token)
'
Console.ReadKey()
Task.Delay(TimeSpan.FromSeconds(5))
LogCtsSrc.Cancel()
'
Dim j As Integer = 0
ContainerLogs.ForEach(Sub(X)
j = j + 1
Console.WriteLine(j.ToString & ": " & X)
End Sub)
Unfortunately, last records don't read from docker socket and don't pass to my software. Please see to screenshot.
What I doing wrong and how to force pass last log records from buffer to my software?
The text was updated successfully, but these errors were encountered:
I try to use this package with my project, but failed. Unfortunately many function working in my project with troubles. This is my code to read docker container logs.
Unfortunately, last records don't read from docker socket and don't pass to my software. Please see to screenshot.
What I doing wrong and how to force pass last log records from buffer to my software?
The text was updated successfully, but these errors were encountered: