1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

Add Additional Logging to Self-hosted installs for F4E (#1999)

* Add logging to SH logs

* Fix tests
This commit is contained in:
Justin Baur
2022-05-16 09:57:00 -04:00
committed by GitHub
parent 6b484e29a7
commit 53241f16e0
5 changed files with 56 additions and 7 deletions

View File

@ -14,6 +14,7 @@ using Bit.Core.Settings;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace Bit.Admin.Controllers
{
@ -34,6 +35,7 @@ namespace Bit.Admin.Controllers
private readonly GlobalSettings _globalSettings;
private readonly IReferenceEventService _referenceEventService;
private readonly IUserService _userService;
private readonly ILogger<OrganizationsController> _logger;
public OrganizationsController(
IOrganizationRepository organizationRepository,
@ -49,7 +51,8 @@ namespace Bit.Admin.Controllers
IApplicationCacheService applicationCacheService,
GlobalSettings globalSettings,
IReferenceEventService referenceEventService,
IUserService userService)
IUserService userService,
ILogger<OrganizationsController> logger)
{
_organizationRepository = organizationRepository;
_organizationUserRepository = organizationUserRepository;
@ -65,6 +68,7 @@ namespace Bit.Admin.Controllers
_globalSettings = globalSettings;
_referenceEventService = referenceEventService;
_userService = userService;
_logger = logger;
}
public async Task<IActionResult> Index(string name = null, string userEmail = null, bool? paid = null,
@ -199,6 +203,7 @@ namespace Bit.Admin.Controllers
catch (Exception ex)
{
TempData["ConnectionError"] = ex.Message;
_logger.LogWarning(ex, "Error while attempting to do billing sync for organization with id '{OrganizationId}'", id);
}
if (_globalSettings.SelfHosted)