Add debug messages

This commit is contained in:
nicolas.dorier 2018-01-18 18:12:01 +09:00
parent b47b4b10cb
commit 5ba322ea6a
3 changed files with 7 additions and 1 deletions

View file

@ -25,6 +25,7 @@ using Microsoft.Extensions.Caching.Memory;
using BTCPayServer.Eclair; using BTCPayServer.Eclair;
using System.Collections.Generic; using System.Collections.Generic;
using BTCPayServer.Models.StoreViewModels; using BTCPayServer.Models.StoreViewModels;
using System.Threading.Tasks;
namespace BTCPayServer.Tests namespace BTCPayServer.Tests
{ {

View file

@ -412,6 +412,7 @@ namespace BTCPayServer.HostedServices
{ {
if (invoiceId == null) if (invoiceId == null)
throw new ArgumentNullException(nameof(invoiceId)); throw new ArgumentNullException(nameof(invoiceId));
Logs.PayServer.LogInformation($"Watching {invoiceId}");
_WatchRequests.Add(invoiceId); _WatchRequests.Add(invoiceId);
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId); var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
try try
@ -485,6 +486,7 @@ namespace BTCPayServer.HostedServices
{ {
try try
{ {
Logs.PayServer.LogInformation($"Updating {i}");
await UpdateInvoice(i, cancellation); await UpdateInvoice(i, cancellation);
} }
catch (Exception ex) when (!cancellation.IsCancellationRequested) catch (Exception ex) when (!cancellation.IsCancellationRequested)
@ -492,7 +494,9 @@ namespace BTCPayServer.HostedServices
Logs.PayServer.LogCritical(ex, $"Error in the InvoiceWatcher loop (Invoice {i})"); Logs.PayServer.LogCritical(ex, $"Error in the InvoiceWatcher loop (Invoice {i})");
await Task.Delay(2000, cancellation); await Task.Delay(2000, cancellation);
} }
finally { executing.TryRemove(i, out Task useless); } finally {
Logs.PayServer.LogInformation($"Updated {i}");
executing.TryRemove(i, out Task useless); }
}); });
} }
} }

View file

@ -45,6 +45,7 @@ namespace BTCPayServer
.ConfigureLogging(l => .ConfigureLogging(l =>
{ {
l.AddFilter("Microsoft", LogLevel.Error); l.AddFilter("Microsoft", LogLevel.Error);
l.AddFilter("Microsoft.AspNetCore.Antiforgery.Internal", LogLevel.Critical);
l.AddProvider(new CustomConsoleLogProvider(processor)); l.AddProvider(new CustomConsoleLogProvider(processor));
}) })
.UseStartup<Startup>() .UseStartup<Startup>()