-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add logging to tokenables (#2298) * Add logging to token usages * Add settings manipulation of log levels * Maintain no logging for dev * Log exception causing Token failure in TryUnprotect * dotnet format 🤖 * Added deconstruction operator on new debug logs. * Split off log level settings into separate files * Improve log messages * dotnet format 🤖 * Fix token serialization * Final review notes Co-authored-by: Todd Martin <> (cherry picked from commit c8c9b32) * Added missing } * Linting fix. * Add logger to constructor Co-authored-by: Todd Martin <>
- Loading branch information
Showing
29 changed files
with
269 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings | ||
{ | ||
public interface ILogLevelSettings | ||
{ | ||
IBillingLogLevelSettings BillingSettings { get; set; } | ||
IApiLogLevelSettings ApiSettings { get; set; } | ||
IIdentityLogLevelSettings IdentitySettings { get; set; } | ||
IScimLogLevelSettings ScimSettings { get; set; } | ||
ISsoLogLevelSettings SsoSettings { get; set; } | ||
IAdminLogLevelSettings AdminSettings { get; set; } | ||
IEventsLogLevelSettings EventsSettings { get; set; } | ||
IEventsProcessorLogLevelSettings EventsProcessorSettings { get; set; } | ||
IIconsLogLevelSettings IconsSettings { get; set; } | ||
INotificationsLogLevelSettings NotificationsSettings { get; set; } | ||
} | ||
|
||
public interface IBillingLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
LogEventLevel Jobs { get; set; } | ||
} | ||
|
||
public interface IApiLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
LogEventLevel IdentityToken { get; set; } | ||
LogEventLevel IpRateLimit { get; set; } | ||
} | ||
|
||
public interface IIdentityLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
LogEventLevel IdentityToken { get; set; } | ||
LogEventLevel IpRateLimit { get; set; } | ||
} | ||
|
||
public interface IScimLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
} | ||
|
||
public interface ISsoLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
} | ||
|
||
public interface IAdminLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
} | ||
|
||
public interface IEventsLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
LogEventLevel IdentityToken { get; set; } | ||
} | ||
|
||
public interface IEventsProcessorLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
} | ||
|
||
public interface IIconsLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
} | ||
|
||
public interface INotificationsLogLevelSettings | ||
{ | ||
LogEventLevel Default { get; set; } | ||
LogEventLevel IdentityToken { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Core/Settings/LoggingSettings/AdminLogLevelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class AdminLogLevelSettings : IAdminLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Error; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class ApiLogLevelSettings : IApiLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Error; | ||
public LogEventLevel IdentityToken { get; set; } = LogEventLevel.Fatal; | ||
public LogEventLevel IpRateLimit { get; set; } = LogEventLevel.Information; | ||
} | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
src/Core/Settings/LoggingSettings/BillingLogLevelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class BillingLogLevelSettings : IBillingLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Warning; | ||
public LogEventLevel Jobs { get; set; } = LogEventLevel.Information; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Core/Settings/LoggingSettings/EventsLogLevelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class EventsLogLevelSettings : IEventsLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Error; | ||
public LogEventLevel IdentityToken { get; set; } = LogEventLevel.Fatal; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Core/Settings/LoggingSettings/EventsProcessorLogLevelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class EventsProcessorLogLevelSettings : IEventsProcessorLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Warning; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class IconsLogLevelSettings : IIconsLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Error; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Core/Settings/LoggingSettings/IdentityLogLevelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class IdentityLogLevelSettings : IIdentityLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Error; | ||
public LogEventLevel IdentityToken { get; set; } = LogEventLevel.Fatal; | ||
public LogEventLevel IpRateLimit { get; set; } = LogEventLevel.Information; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
| ||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class LogLevelSettings : ILogLevelSettings | ||
{ | ||
public IBillingLogLevelSettings BillingSettings { get; set; } = new BillingLogLevelSettings(); | ||
public IApiLogLevelSettings ApiSettings { get; set; } = new ApiLogLevelSettings(); | ||
public IIdentityLogLevelSettings IdentitySettings { get; set; } = new IdentityLogLevelSettings(); | ||
public IScimLogLevelSettings ScimSettings { get; set; } = new ScimLogLevelSettings(); | ||
public ISsoLogLevelSettings SsoSettings { get; set; } = new SsoLogLevelSettings(); | ||
public IAdminLogLevelSettings AdminSettings { get; set; } = new AdminLogLevelSettings(); | ||
public IEventsLogLevelSettings EventsSettings { get; set; } = new EventsLogLevelSettings(); | ||
public IEventsProcessorLogLevelSettings EventsProcessorSettings { get; set; } = new EventsProcessorLogLevelSettings(); | ||
public IIconsLogLevelSettings IconsSettings { get; set; } = new IconsLogLevelSettings(); | ||
public INotificationsLogLevelSettings NotificationsSettings { get; set; } = new NotificationsLogLevelSettings(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Core/Settings/LoggingSettings/NotificationsLogLevelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class NotificationsLogLevelSettings : INotificationsLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Warning; | ||
public LogEventLevel IdentityToken { get; set; } = LogEventLevel.Fatal; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class ScimLogLevelSettings : IScimLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Warning; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Serilog.Events; | ||
|
||
namespace Bit.Core.Settings.LoggingSettings | ||
{ | ||
public class SsoLogLevelSettings : ISsoLogLevelSettings | ||
{ | ||
public LogEventLevel Default { get; set; } = LogEventLevel.Error; | ||
} | ||
} |
Oops, something went wrong.