ElasticSearchConfigurationIsExclusiveMode Property
是否啟用獨佔模式
Namespace: eBizprise.Framework.Log.ElasticSearchAssembly: eBizprise.Framework.Log.LogHelper.ElasticSearch (in eBizprise.Framework.Log.LogHelper.ElasticSearch.dll) Version: 25.0.3.0+6e92afb880fa099fdfe407c9aa8d1b17eaaf3625
public bool IsExclusiveMode { get; set; }
Property Value
Boolean
設定為 true 時,會自動清除所有非 ElasticSearch 的日誌目標 (Target),
讓 ElasticSearch 成為唯一的日誌輸出目標。
預設值為 false
// 啟用獨佔模式 - 只輸出到 ElasticSearch
LogHelper.Configure(config =>
{
config.UseElasticSearch(new ElasticSearchConfiguration
{
Uri = "http://localhost:9200",
IsExclusiveMode = true
});
});
| Date | Version | Description |
|---|
| 2025/12/16 | 25.0.2.0 | 新增獨佔模式設定,移除 RequireAuth 設定 |