LogConfigurationAddTarget Method

新增自訂 Target

Definition

Namespace: eBizprise.Framework
Assembly: eBizprise.Framework.Log.LogHelper (in eBizprise.Framework.Log.LogHelper.dll) Version: 25.0.5.0+6e92afb880fa099fdfe407c9aa8d1b17eaaf3625
C#
public LogConfiguration AddTarget(
	string targetName,
	Target target,
	LogLevel minLevel = null,
	LogLevel maxLevel = null
)

Parameters

targetName  String
Target 名稱
target  Target
Target 物件
minLevel  LogLevel  (Optional)
最低等級
maxLevel  LogLevel  (Optional)
最高等級

Return Value

LogConfiguration
配置物件(支援鏈式呼叫)

Example

C#
var customTarget = new FileTarget("custom")
{
    FileName = "${var:main}/custom.log"
};
config.AddTarget("custom", customTarget, LogLevel.Info);

See Also