forked from sim0n00ps/OF-DL
More logging tweaks
This commit is contained in:
parent
333e91d01c
commit
5f1870f32f
@ -117,7 +117,7 @@ public class Program
|
||||
.Enrich.WithProperty("StartTime", $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} ")
|
||||
.Enrich.WithProperty("MachineName", Environment.MachineName)
|
||||
.MinimumLevel.ControlledBy(levelSwitch)
|
||||
.WriteTo.File("logs/OFDL.txt", rollingInterval: RollingInterval.Day)
|
||||
.WriteTo.File("logs/OFDL.txt", rollingInterval: RollingInterval.Day, restrictedToMinimumLevel: LogEventLevel.Error)
|
||||
.WriteTo.Seq("https://seq.cajetan.dk")
|
||||
.CreateLogger();
|
||||
|
||||
@ -986,10 +986,12 @@ public class Program
|
||||
|
||||
using (LogContext.PushProperty("Username", username))
|
||||
using (LogContext.PushProperty("UserId", userId))
|
||||
using (LogContext.PushProperty("UserNum", prevValue+1))
|
||||
using (LogContext.PushProperty("UserTotal", users.Count))
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.Information("Updating User Info for for: {Username:l}");
|
||||
Log.Information("[{UserNum:0} of {UserTotal}] Updating User Info for for: {Username:l}");
|
||||
User? user_info = await m_ApiHelper.GetUserInfo(username, $"/users/{username}");
|
||||
await dbHelper.UpdateUserInfo(username, user_info);
|
||||
|
||||
@ -997,7 +999,7 @@ public class Program
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Warning(ex, "Failed to update User Info for: {Username:l}");
|
||||
Log.Warning(ex, "[{UserNum:0} of {UserTotal}] Failed to update User Info for: {Username:l}");
|
||||
AnsiConsole.Markup($"[red]Failed to update User Info for '{username}'\n[/]");
|
||||
|
||||
updateTask.Description = $"{description} - FAILED: {ex.Message}";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user