first commit
This commit is contained in:
54
MyNewProjectName.Infrastructure/Options/SerilogOptions.cs
Normal file
54
MyNewProjectName.Infrastructure/Options/SerilogOptions.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
namespace MyNewProjectName.Infrastructure.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Serilog logging configuration options
|
||||
/// </summary>
|
||||
public class SerilogOptions
|
||||
{
|
||||
public const string SectionName = "Serilog";
|
||||
|
||||
/// <summary>
|
||||
/// Minimum log level
|
||||
/// </summary>
|
||||
public string MinimumLevel { get; set; } = "Information";
|
||||
|
||||
/// <summary>
|
||||
/// Override log levels for specific namespaces
|
||||
/// </summary>
|
||||
public Dictionary<string, string> Override { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Write to console
|
||||
/// </summary>
|
||||
public bool WriteToConsole { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Write to file
|
||||
/// </summary>
|
||||
public bool WriteToFile { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// File path for logs (relative to application root)
|
||||
/// </summary>
|
||||
public string FilePath { get; set; } = "logs/log-.txt";
|
||||
|
||||
/// <summary>
|
||||
/// Rolling interval for log files
|
||||
/// </summary>
|
||||
public string RollingInterval { get; set; } = "Day";
|
||||
|
||||
/// <summary>
|
||||
/// Retained file count limit
|
||||
/// </summary>
|
||||
public int RetainedFileCountLimit { get; set; } = 31;
|
||||
|
||||
/// <summary>
|
||||
/// Seq server URL (optional)
|
||||
/// </summary>
|
||||
public string? SeqUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Elasticsearch URL (optional)
|
||||
/// </summary>
|
||||
public string? ElasticsearchUrl { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user