C# Class Ywdsoft.Utility.LogHelper

使用LOG4NET记录日志的功能,在WEB.CONFIG里要配置相应的节点
Datei anzeigen Open project: CrazyJson/TaskManager

Public Properties

Property Type Description
logerror log4net.ILog
loginfo log4net.ILog

Public Methods

Method Description
GetLogger ( ) : log4net.ILog
GetLogger ( string repositoryName, string level ) : log4net.ILog

获取ILog对象

LogHelper ( string repositoryName, string level ) : System

初始化

解决任务和日志对应问题

SetConfig ( ) : void
SetConfig ( FileInfo configFile ) : void
WriteLog ( string info ) : void

普通的文件记录日志

WriteLog ( string info, Exception se ) : void

错误日志

WriteLogE ( string info ) : void

普通的文件记录日志

WriteLogE ( string info, Exception ex ) : void

错误日志

Private Methods

Method Description
GetLevelName ( log4net.Core.Level code ) : string
GetRepositoryNameName ( string repositoryName, string code ) : string
LoadFileAppender ( ILoggerRepository repository ) : void

使用文本记录信息

Method Details

GetLogger() public method

public GetLogger ( ) : log4net.ILog
return log4net.ILog

GetLogger() public static method

获取ILog对象
public static GetLogger ( string repositoryName, string level ) : log4net.ILog
repositoryName string 职责名称,如果不存在则创建
level string
return log4net.ILog

LogHelper() public method

初始化
解决任务和日志对应问题
public LogHelper ( string repositoryName, string level ) : System
repositoryName string 职责名称
level string
return System

SetConfig() public static method

public static SetConfig ( ) : void
return void

SetConfig() public static method

public static SetConfig ( FileInfo configFile ) : void
configFile System.IO.FileInfo
return void

WriteLog() public static method

普通的文件记录日志
public static WriteLog ( string info ) : void
info string
return void

WriteLog() public static method

错误日志
public static WriteLog ( string info, Exception se ) : void
info string
se System.Exception
return void

WriteLogE() public method

普通的文件记录日志
public WriteLogE ( string info ) : void
info string
return void

WriteLogE() public method

错误日志
public WriteLogE ( string info, Exception ex ) : void
info string
ex System.Exception
return void

Property Details

logerror public_oe static_oe property

public static ILog,log4net logerror
return log4net.ILog

loginfo public_oe static_oe property

public static ILog,log4net loginfo
return log4net.ILog