init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,62 @@
|
|||
using System.Configuration;
|
||||
using Kreta.Core.MessageBroker.Logging.Serilog.Configuration;
|
||||
|
||||
namespace Kreta.MessageBroker.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Serilog - Elastic search konfiguráció
|
||||
/// </summary>
|
||||
public class SerilogConfigurationElement : ConfigurationElement, ISerilogConfiguration
|
||||
{
|
||||
#region [Properties]
|
||||
|
||||
/// <summary>
|
||||
/// Lossy buffer count
|
||||
/// </summary>
|
||||
[ConfigurationProperty(nameof(LossyBufferSize), IsRequired = true)]
|
||||
public int LossyBufferSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)base[nameof(LossyBufferSize)];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serilog loggers
|
||||
/// </summary>
|
||||
[ConfigurationProperty(nameof(ElasticSearch), IsRequired = false)]
|
||||
public ElasticSearchConfigurationElement ElasticSearch
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ElasticSearchConfigurationElement)base[nameof(ElasticSearch)];
|
||||
}
|
||||
}
|
||||
|
||||
IElasticSearchConfiguration ISerilogConfiguration.ElasticSearch
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ElasticSearch;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [Protected methods]
|
||||
|
||||
/// <summary>
|
||||
/// Custom validations
|
||||
/// </summary>
|
||||
protected override void PostDeserialize()
|
||||
{
|
||||
if (!this.ElasticSearch.ElementInformation.IsPresent)
|
||||
{
|
||||
throw new ConfigurationErrorsException($"At least one logger sink must be defined. (e.g:{nameof(ElasticSearch)})");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue