Add proper server starting and stopping logging.
MODIFY
WalletWasabi.Backend/Global.cs
WalletWasabi.Backend/Global.cs
@@ -58,8 +58,10 @@ namespace WalletWasabi.Backend
Coordinator = new CcjCoordinator(RpcClient.Network, Path.Combine(DataDir, nameof(CcjCoordinator)), RpcClient, roundConfig);
IndexBuilderService.NewBlock += IndexBuilderService_NewBlockAsync;
IndexBuilderService.Synchronize();
+ Logger.LogInfo<IndexBuilderService>("IndexBuilderService is successfully initialized and started syncronization.");
await Coordinator.MakeSureTwoRunningRoundsAsync();
+ Logger.LogInfo<CcjCoordinator>("Chaumian CoinJoin Coordinator is successfully initialized and started two new rounds.");
if (roundConfig.FilePath != null)
{
@@ -78,6 +80,7 @@ namespace WalletWasabi.Backend
return Task.CompletedTask;
}); // Every 10 seconds check the config
+ Logger.LogInfo<ConfigWatcher>("RoundConfigWatcher is successfully started.");
}
}
@@ -136,7 +139,7 @@ namespace WalletWasabi.Backend
}
catch(WebException)
{
- Logger.LogInfo($"Bitcoin Core is not running, or incorrect RPC credentials or network is given in the config file: `{Config.FilePath}`.");
+ Logger.LogError($"Bitcoin Core is not running, or incorrect RPC credentials or network is given in the config file: `{Config.FilePath}`.");
throw;
}
}

MODIFY
WalletWasabi.Backend/Program.cs
WalletWasabi.Backend/Program.cs
@@ -28,10 +28,12 @@ namespace WalletWasabi.Backend
var configFilePath = Path.Combine(Global.DataDir, "Config.json");
var config = new Config(configFilePath);
await config.LoadOrCreateDefaultFileAsync();
+ Logger.LogInfo<Config>("Config is successfully initialized.");
var roundConfigFilePath = Path.Combine(Global.DataDir, "CcjRoundConfig.json");
var roundConfig = new CcjRoundConfig(roundConfigFilePath);
await roundConfig.LoadOrCreateDefaultFileAsync();
+ Logger.LogInfo<CcjRoundConfig>("RoundConfig is successfully initialized.");
var rpc = new RPCClient(
credentials: new RPCCredentialString
@@ -54,7 +56,7 @@ namespace WalletWasabi.Backend
}
catch (Exception ex)
{
- Logger.LogWarning<Program>(ex);
+ Logger.LogError<Program>(ex);
}
}
}

MODIFY
WalletWasabi.Backend/Startup.cs
WalletWasabi.Backend/Startup.cs
@@ -11,6 +11,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Swashbuckle.AspNetCore.Swagger;
+using WalletWasabi.Logging;
namespace WalletWasabi.Backend
{
@@ -68,6 +69,7 @@ namespace WalletWasabi.Backend
private async Task CleanupAsync()
{
Global.Coordinator?.Dispose();
+ Logger.LogInfo<Startup>("Coordinator is disposed.");
var stopTasks = new List<Task>();
@@ -86,6 +88,8 @@ namespace WalletWasabi.Backend
}
await Task.WhenAll(stopTasks);
+ Logger.LogInfo<Startup>("IndexBuilderService is disposed.");
+ Logger.LogInfo<Startup>("RoundConfigWatcher is disposed.");
}
}
}

Add proper server starting and stopping logging.