1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-07 10:55:43 -05:00

[PM-6167] Remove cosmos logging sink (#3769)

* get rid of cosmos logging sink

* remove logs from layout

* delete log models

* remove logs_view permission

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
Kyle Spearrin
2024-02-08 13:35:45 -05:00
committed by GitHub
parent 6cc53b4739
commit 3e73f1cb4a
12 changed files with 10 additions and 336 deletions

View File

@ -34,6 +34,7 @@
<PackageReference Include="Handlebars.Net" Version="2.1.4" />
<PackageReference Include="MailKit" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.25" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.38.0" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="4.1.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
@ -48,7 +49,6 @@
<PackageReference Include="Sentry.Serilog" Version="3.41.3" />
<PackageReference Include="Duende.IdentityServer" Version="6.3.7" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog.Sinks.AzureCosmosDB" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.SyslogMessages" Version="2.0.9" />
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
<PackageReference Include="Braintree" Version="5.23.0" />

View File

@ -61,7 +61,6 @@ public class GlobalSettings : IGlobalSettings
public virtual FileStorageSettings Send { get; set; }
public virtual IdentityServerSettings IdentityServer { get; set; } = new IdentityServerSettings();
public virtual DataProtectionSettings DataProtection { get; set; }
public virtual DocumentDbSettings DocumentDb { get; set; } = new DocumentDbSettings();
public virtual SentrySettings Sentry { get; set; } = new SentrySettings();
public virtual SyslogSettings Syslog { get; set; } = new SyslogSettings();
public virtual ILogLevelSettings MinLogLevel { get; set; } = new LogLevelSettings();
@ -351,12 +350,6 @@ public class GlobalSettings : IGlobalSettings
}
}
public class DocumentDbSettings
{
public string Uri { get; set; }
public string Key { get; set; }
}
public class SentrySettings
{
public string Dsn { get; set; }

View File

@ -60,16 +60,7 @@ public static class LoggerFactoryExtensions
.Enrich.FromLogContext()
.Filter.ByIncludingOnly(inclusionPredicate);
if (CoreHelpers.SettingHasValue(globalSettings?.DocumentDb.Uri) &&
CoreHelpers.SettingHasValue(globalSettings?.DocumentDb.Key))
{
config.WriteTo.AzureCosmosDB(new Uri(globalSettings.DocumentDb.Uri),
globalSettings.DocumentDb.Key, timeToLive: TimeSpan.FromDays(7),
partitionKey: "_partitionKey")
.Enrich.FromLogContext()
.Enrich.WithProperty("Project", globalSettings.ProjectName);
}
else if (CoreHelpers.SettingHasValue(globalSettings?.Sentry.Dsn))
if (CoreHelpers.SettingHasValue(globalSettings?.Sentry.Dsn))
{
config.WriteTo.Sentry(globalSettings.Sentry.Dsn)
.Enrich.FromLogContext()