Skip to content

Commit c65ab13

Browse files
authored
Logging exceptions thrown during init, start and stop (#4883)
1 parent 817e842 commit c65ab13

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/ServiceControl.Audit/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
return 0;
4040
}
41+
catch (Exception ex)
42+
{
43+
NLog.LogManager.GetCurrentClassLogger().Fatal(ex, "Unrecoverable error");
44+
throw;
45+
}
4146
finally
4247
{
4348
// The following log statement is meant to leave a trail in the logs to determine if the process was killed

src/ServiceControl.Monitoring/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030

3131
return 0;
3232
}
33+
catch (Exception ex)
34+
{
35+
NLog.LogManager.GetCurrentClassLogger().Fatal(ex, "Unrecoverable error");
36+
throw;
37+
}
3338
finally
3439
{
3540
// The following log statement is meant to leave a trail in the logs to determine if the process was killed

src/ServiceControl/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
return 0;
4040
}
41+
catch (Exception ex)
42+
{
43+
NLog.LogManager.GetCurrentClassLogger().Fatal(ex, "Unrecoverable error");
44+
throw;
45+
}
4146
finally
4247
{
4348
// The following log statement is meant to leave a trail in the logs to determine if the process was killed

0 commit comments

Comments
 (0)