LogConfigurationAddTarget Method
新增自訂 Target
Namespace: eBizprise.FrameworkAssembly: eBizprise.Framework.Log.LogHelper (in eBizprise.Framework.Log.LogHelper.dll) Version: 25.0.4.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
public LogConfiguration AddTarget(
string targetName,
Target target,
LogLevel minLevel = null,
LogLevel maxLevel = null
)
- targetName String
- Target 名稱
- target Target
- Target 物件
- minLevel LogLevel (Optional)
- 最低等級
- maxLevel LogLevel (Optional)
- 最高等級
LogConfiguration配置物件(支援鏈式呼叫)
var customTarget = new FileTarget("custom")
{
FileName = "${var:main}/custom.log"
};
config.AddTarget("custom", customTarget, LogLevel.Info);