feat: Logging für unerwartete Ausnahmen hinzugefügt, um eine bessere Fehlerverfolgung und Problemlösung zu gewährleisten.
This commit is contained in:
parent
8ef879a663
commit
a69e13c2ab
@ -17,6 +17,8 @@ using NLog.Web;
|
||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||
logger.Info("Logging initialized.");
|
||||
|
||||
try
|
||||
{
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Configuration.AddJsonFile("consumer-repository.json", true, true);
|
||||
@ -148,3 +150,9 @@ app.MapControllers();
|
||||
app.MapHub<AuthHub>("/auth-hub");
|
||||
|
||||
app.Run();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
logger.Error(ex, "Stopped program because of exception.");
|
||||
throw;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user