• 大小: 2.06M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-26
  • 语言: C#
  • 标签: log4net  NET  案例  

资源简介

练习Log4Net,日志自动到数据库 自动到指定文件夹的log文件,到控制台

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;

namespace Log4NetDemo
{
    class Program
    {

        static void Main(string[] args)
        {
            ILog log = LogManager.GetLogger(“log4netDemo“);
            //Program program = new Program();
            log4net.Config.xmlConfigurator.Configure();
            log.Debug(“我是Debug“);
            log.Info(“现在是某某以上给${某某}“);
            log.Error(“我是Errow“);
            Console.ReadLine();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-11-18 19:49  练习Log4Net\
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\.vs\
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\.vs\Log4NetDemo\
     目录           0  2020-11-18 19:39  练习Log4Net\Log4NetDemo\.vs\Log4NetDemo\v16\
     文件        3584  2020-11-18 19:39  练习Log4Net\Log4NetDemo\.vs\Log4NetDemo\v16\.suo
     目录           0  2020-11-18 19:47  练习Log4Net\Log4NetDemo\Log4NetDemo\
     文件        3509  2020-11-18 19:43  练习Log4Net\Log4NetDemo\Log4NetDemo\App.config
     文件        2661  2020-11-18 19:47  练习Log4Net\Log4NetDemo\Log4NetDemo\Log4NetDemo.csproj
     文件         228  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\Log4NetDemo.csproj.user
     文件         606  2020-11-18 19:47  练习Log4Net\Log4NetDemo\Log4NetDemo\Program.cs
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\Properties\
     文件        1346  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\Properties\AssemblyInfo.cs
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\
     文件        5120  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\Log4NetDemo.exe
     文件        3491  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\Log4NetDemo.exe.config
     文件       11776  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\Log4NetDemo.pdb
     文件       23168  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\Log4NetDemo.vshost.exe
     文件        3491  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\Log4NetDemo.vshost.exe.config
     文件      270336  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Debug\log4net.dll
     目录           0  2020-11-18 19:49  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\Release\
     文件      270336  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\bin\log4net.dll
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\
     目录           0  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\
     文件         210  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\.NETframeworkVersion=v4.5.AssemblyAttributes.cs
     文件        6753  2020-11-18 19:47  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         666  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\Log4NetDemo.csproj.FileListAbsolute.txt
     文件       21962  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\Log4NetDemo.csprojAssemblyReference.cache
     文件        8507  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\Log4NetDemo.csprojResolveAssemblyReference.cache
     文件        5120  2020-11-18 19:36  练习Log4Net\Log4NetDemo\Log4NetDemo\obj\Debug\Log4NetDemo.exe
............此处省略7个文件信息

评论

共有 条评论