单态封装log4net

  /// <summary>
    /// 类,事件日志类。
    /// 单态封装log4net
    /// </summary>
    public class EventLog
    {
        private static log4net.ILog log = null;
        private static object lockHelper = new object();

        public static log4net.ILog Log
        {
            get
            {
                if (log == null)
                    lock (lockHelper)
                        if (log == null)
                            log = log4net.LogManager.GetLogger("");
                return log;
            }
        }
    }

posted @ 2011-02-09 15:23  x4646  阅读(530)  评论(0编辑  收藏  举报