Add project files.
This commit is contained in:
120
Core.Blueprint.Logging/Adapters/LogDetail.cs
Normal file
120
Core.Blueprint.Logging/Adapters/LogDetail.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
// ***********************************************************************
|
||||
// <copyright file="LogDetail.cs">
|
||||
// Heath
|
||||
// </copyright>
|
||||
// ***********************************************************************
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Core.Blueprint.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// The service logger detail object.
|
||||
/// </summary>
|
||||
/// <typeparam name="TMessage">The generic message type.</typeparam>
|
||||
public class LogDetail<TMessage>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the log severity.
|
||||
/// </summary>
|
||||
/// <example>info</example>
|
||||
[DisplayName(DisplayNames.Severity)]
|
||||
[JsonPropertyName(DisplayNames.Severity)]
|
||||
public LogSeverity Severity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timestamp.
|
||||
/// </summary>
|
||||
[DisplayName(DisplayNames.Timestamp)]
|
||||
[JsonPropertyName(DisplayNames.Timestamp)]
|
||||
public DateTime Timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the environment.
|
||||
/// </summary>
|
||||
/// <example>Development</example>
|
||||
[DisplayName(DisplayNames.Environment)]
|
||||
[JsonPropertyName(DisplayNames.Environment)]
|
||||
public string? Environment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the target.
|
||||
/// </summary>
|
||||
[DisplayName(DisplayNames.Target)]
|
||||
[JsonPropertyName(DisplayNames.Target)]
|
||||
public LogTarget? Target { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the x-forwarded-for header.
|
||||
/// </summary>
|
||||
/// <example>localhost</example>
|
||||
[DisplayName(DisplayNames.XForwardedFor)]
|
||||
[JsonPropertyName(DisplayNames.XForwardedFor)]
|
||||
public string? XForwardedFor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the service identifier.
|
||||
/// </summary>
|
||||
/// <example><see cref="Guid.NewGuid()"/></example>
|
||||
[DisplayName(DisplayNames.ServiceId)]
|
||||
[JsonPropertyName(DisplayNames.ServiceId)]
|
||||
public string? ServiceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the request identifier.
|
||||
/// </summary>
|
||||
/// <example><see cref="Guid.NewGuid()"/></example>
|
||||
[DisplayName(DisplayNames.RequestId)]
|
||||
[JsonPropertyName(DisplayNames.RequestId)]
|
||||
public string? RequestId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the keyVaultProvider identifier.
|
||||
/// </summary>
|
||||
/// <example><see cref="Guid.NewGuid()"/></example>
|
||||
[DisplayName(DisplayNames.ClientId)]
|
||||
[JsonPropertyName(DisplayNames.ClientId)]
|
||||
public string? ClientId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the keyVaultProvider identifier.
|
||||
/// </summary>
|
||||
/// <example>keyVaultProviderRequest</example>
|
||||
[DisplayName(DisplayNames.Operation)]
|
||||
[JsonPropertyName(DisplayNames.Operation)]
|
||||
public LogOperation Operation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user name.
|
||||
/// </summary>
|
||||
/// <example>keyVaultProviderRequest</example>
|
||||
[DisplayName(DisplayNames.User)]
|
||||
[JsonPropertyName(DisplayNames.User)]
|
||||
public string? User { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets user's email.
|
||||
/// </summary>
|
||||
/// <example>keyVaultProviderRequest</example>
|
||||
[DisplayName(DisplayNames.Email)]
|
||||
[JsonPropertyName(DisplayNames.Email)]
|
||||
public string? Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user identifier.
|
||||
/// </summary>
|
||||
/// <example>keyVaultProviderRequest</example>
|
||||
[DisplayName(DisplayNames.UserId)]
|
||||
[JsonPropertyName(DisplayNames.UserId)]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the message.
|
||||
/// </summary>
|
||||
/// <example>A custom log message.</example>
|
||||
[DisplayName(DisplayNames.Message)]
|
||||
[JsonPropertyName(DisplayNames.Message)]
|
||||
public TMessage? Message { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user