();
-
var host = builder.Build();
Log.Logger = (ILogger)host.Services.GetService(typeof(ILogger))!;
MainLogger.Information("Application is starting");
@@ -108,7 +111,7 @@ private static void AddDefaultConfig(IConfigurationBuilder builder)
["Serilog:Using:0"] = "Serilog.Sinks.File",
["Serilog:Using:1"] = "Serilog.Sinks.Console",
- ["Serilog:MinimumLevel"] = "Information",
+ ["Serilog:MinimumLevel"] = DefaultLogLevel,
["Serilog:Enrich:0"] = "FromLogContext",
["Serilog:WriteTo:0:Name"] = "File",
diff --git a/Vpn.Service/TunnelSupervisor.cs b/Vpn.Service/TunnelSupervisor.cs
index a323cac..7dd6738 100644
--- a/Vpn.Service/TunnelSupervisor.cs
+++ b/Vpn.Service/TunnelSupervisor.cs
@@ -99,18 +99,16 @@ public async Task StartAsync(string binPath,
},
};
// TODO: maybe we should change the log format in the inner binary
- // to something without a timestamp
- var outLogger = Log.ForContext("SourceContext", "coder-vpn.exe[OUT]");
- var errLogger = Log.ForContext("SourceContext", "coder-vpn.exe[ERR]");
+ // to something without a timestamp
_subprocess.OutputDataReceived += (_, args) =>
{
if (!string.IsNullOrWhiteSpace(args.Data))
- outLogger.Debug("{Data}", args.Data);
+ _logger.LogInformation("stdout: {Data}", args.Data);
};
_subprocess.ErrorDataReceived += (_, args) =>
{
if (!string.IsNullOrWhiteSpace(args.Data))
- errLogger.Debug("{Data}", args.Data);
+ _logger.LogInformation("stderr: {Data}", args.Data);
};
// Pass the other end of the pipes to the subprocess and dispose
diff --git a/Vpn/Speaker.cs b/Vpn/Speaker.cs
index d113a50..37ec554 100644
--- a/Vpn/Speaker.cs
+++ b/Vpn/Speaker.cs
@@ -123,7 +123,7 @@ public async Task StartAsync(CancellationToken ct = default)
// Handshakes should always finish quickly, so enforce a 5s timeout.
using var cts = CancellationTokenSource.CreateLinkedTokenSource(ct, _cts.Token);
cts.CancelAfter(TimeSpan.FromSeconds(5));
- await PerformHandshake(ct);
+ await PerformHandshake(cts.Token);
// Start ReceiveLoop in the background.
_receiveTask = ReceiveLoop(_cts.Token);
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy