C# Console use Log4net

 
 static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo( "./log4net.config"));
            log.Info("fffffffffffffff");


            string a = "ff";
            try
            {
                int b = Convert.ToInt32(a);
            }
            catch(Exception ex)
            {
                log.Error(ex.ToString());
                string ss=ex.ToString().Replace("\n", "").Replace("  ", "").Replace("\t", "").Replace("\r", "");
                log.Error(ss);

                int i = ss.Length;
                log.Info(i.ToString());
            }
            Console.ReadKey();

        }



猜你喜欢

转载自blog.csdn.net/farmwang/article/details/80774304
今日推荐