• Windows 服务中正确使用 log4net


    public class Service1 : ServiceBase
    {    
        // 进程的主入口点
        private static void Main()
        {
            string assemblyFilePath = Assembly.GetExecutingAssembly().Location;
            string assemblyDirPath = Path.GetDirectoryName(assemblyFilePath);
            string configFilePath = assemblyDirPath + "//log4net.config";
            DOMConfigurator.ConfigureAndWatch(new FileInfo(configFilePath));
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] {new Service1()};
            ServiceBase.Run(ServicesToRun);
        }
        // 其他略
    }
  • 相关阅读:
    s
    qq
    qqq
    q
    qq
    http请求报文
    qq
    q
    qqq
    java对象-String的用法
  • 原文地址:https://www.cnblogs.com/highfly2012/p/8821564.html
Copyright © 2020-2023  润新知