Newer
Older
IRIS_REFACTOR / irisHelper / LogHelper.cs
yanxiaowei on 11 Aug 2020 716 bytes first commit
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using log4net;

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

namespace irisHelper
{
    public class LogHelper
    {
        /// <summary>
        /// 输出日志到Log4Net
        /// </summary>
        /// <param name="t"></param>
        /// <param name="msg"></param>
        public static void WriteLog(Type t, string msg)
        {
            //ILog log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            log4net.ILog log = log4net.LogManager.GetLogger(t);
            log.Info(System.DateTime.Now.ToString() + " " + msg);
        }


    }
}