LogConfigurationExtensionsUseFileAndElasticSearchFromAppSettings Method
同時使用檔案與 ElasticSearch 日誌
Namespace: eBizprise.Framework.Log.ElasticSearchAssembly: eBizprise.Framework.Log.LogHelper.ElasticSearch (in eBizprise.Framework.Log.LogHelper.ElasticSearch.dll) Version: 25.0.3.0+6e92afb880fa099fdfe407c9aa8d1b17eaaf3625
public static LogConfiguration UseFileAndElasticSearchFromAppSettings(
this LogConfiguration logConfiguration,
string configurationFileName = null,
string fileSectionName = "FileLogging",
string elasticSearchSectionName = "ElasticSearch"
)
- logConfiguration LogConfiguration
- 日誌配置物件
- configurationFileName String (Optional)
- 設定檔名稱 (可選)
- fileSectionName String (Optional)
- 檔案日誌設定區段名稱 (可選,預設: FileLogging)
- elasticSearchSectionName String (Optional)
- 設定區段名稱 (可選,預設: ElasticSearch)
LogConfigurationLogConfiguration 物件 (支援鏈式呼叫)In Visual Basic and C#, you can call this method as an instance method on any object of type
LogConfiguration. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
LogHelper.Configure(config =>
{
config.UseFileAndElasticSearchFromAppSettings(@"C:\Logs");
});
| Date | Version | Description |
|---|
| 2025/12/09 | 25.0.0.0 | 新增從 appsettings 載入的組合方法 |
| 2025/12/16 | 25.0.3.0 | 修改為從 appsettings 載入檔案日誌設定 |