• 大小: 9.26M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-05-01
  • 语言: C#
  • 标签: log4net  NET  Log  管理  C#  

资源简介

C#直接使用log4net进行日志管理实例;使用时需要引用log4net包

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WinformLog4
{
    public partial class Form1 : Form
    {
        public static readonly log4net.ILog log = log4net.LogManager.GetLogger(“Logging“); //Logging 名字要在 App.config 中能找到
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            log.Info(“输出INfO信息“); 
            log.Debug(“输出Debug信息“);
            log.Warn(“输出Warn信息“);
            log.Error(“输出Error信息“);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    I.A....         3  2020-12-11 15:14  WinformLog4\.svn\entries

    I.A....         3  2020-12-11 15:14  WinformLog4\.svn\format

    I.A...R       762  2020-12-11 15:40  WinformLog4\.svn\pristine\01\01b063a06f773a2efef837832d586f379a28ed8d.svn-base

    I.A...R    241664  2020-12-11 15:40  WinformLog4\.svn\pristine\15\15748c1e978479ed4d2290cadf78603e66fbae7b.svn-base

    I.A...R      1233  2020-12-11 15:14  WinformLog4\.svn\pristine\28\28d4f8eabc6955ad587ee83f1f8cab727e6a5395.svn-base

    I.A...R      5817  2020-12-11 15:40  WinformLog4\.svn\pristine\31\31fb76e5d9babe97a11fea041081f96ce426107a.svn-base

    I.A...R     28160  2020-12-11 15:40  WinformLog4\.svn\pristine\3b\3bcbd9f2750cb54c0f4aeb0282438a73cf58f95b.svn-base

    I.A...R      1138  2020-12-11 15:14  WinformLog4\.svn\pristine\3c\3c8dd9aaa5cc1a90c513a07b73c2e2f1ab9ed60d.svn-base

    I.A...R       936  2020-12-11 15:14  WinformLog4\.svn\pristine\43\43b3082589fee6054d9b115c75a3d7f69ce22fd2.svn-base

    I.A...R      5612  2020-12-11 15:14  WinformLog4\.svn\pristine\47\47b15748ecc8e952c5935170090db7c269ce4b4f.svn-base

    I.A...R      3817  2020-12-11 15:40  WinformLog4\.svn\pristine\4a\4aa99e76fb508874d6985d579a4edd6da676ee65.svn-base

    I.A...R    266240  2020-12-11 15:40  WinformLog4\.svn\pristine\53\533c6c0b7315f5ce06d857fcb052b10b8e902fe5.svn-base

    I.A...R   1414816  2020-12-11 15:40  WinformLog4\.svn\pristine\53\538e5e64007520f83152549283d48d4a951f1e17.svn-base

    I.A...R      3309  2020-12-11 15:14  WinformLog4\.svn\pristine\57\576270b52d7fc291d970cf334f5bc50f4fd30ad2.svn-base

    I.A...R      7247  2020-12-11 15:40  WinformLog4\.svn\pristine\58\58389ef2050580463cdae5fba1be2ccf5dfc19a8.svn-base

    I.A...R      2835  2020-12-11 15:14  WinformLog4\.svn\pristine\58\58b64cc80de7d58cdc362a9f01bccbc05f2f5184.svn-base

    I.A...R       249  2020-12-11 15:14  WinformLog4\.svn\pristine\5e\5e1d04de66ffcc5dfd813530ab6992e6daaae417.svn-base

    I.A...R   1536972  2020-12-11 15:40  WinformLog4\.svn\pristine\5f\5fcefc68266eac51aa81347da73625d5ecfe8097.svn-base

    I.A...R       361  2020-12-11 15:14  WinformLog4\.svn\pristine\63\6377be98dcfba5c927037e3284a19efaa9ac9ea0.svn-base

    I.A...R    270336  2020-12-11 15:40  WinformLog4\.svn\pristine\63\63d59196e772434782e1f1be41f54a1b812d71e6.svn-base

    I.A...R    270336  2020-12-11 15:40  WinformLog4\.svn\pristine\64\6426e96243911beab547f2bc98a252a26692f11f.svn-base

    I.A...R   1547454  2020-12-11 15:40  WinformLog4\.svn\pristine\69\6963f874e277a0ad802c266dc2f6f82d12b2da44.svn-base

    I.A...R       492  2020-12-11 15:14  WinformLog4\.svn\pristine\7a\7a423c7b286c4a8dfc4e30f9e271142025fa8984.svn-base

    I.A...R      1314  2020-12-11 15:14  WinformLog4\.svn\pristine\83\8311fcb06a0dd69a9c691f4abaa2e3d3d3633c65.svn-base

    I.A...R   1482420  2020-12-11 15:40  WinformLog4\.svn\pristine\85\851602fddd984dcbe1ce4340f77a5e7775a5a93f.svn-base

    I.A...R      5148  2020-12-11 15:40  WinformLog4\.svn\pristine\88\881265f727e20e831e075b596a830a2d8bcd9a13.svn-base

    I.A...R    258048  2020-12-11 15:40  WinformLog4\.svn\pristine\91\917dd1400db70697a5ed166a99af9f04d9034b0c.svn-base

    I.A...R      9483  2020-12-11 15:40  WinformLog4\.svn\pristine\9e\9e3f900ed0c3ea713fcde14c1c1cdaa9fa32cced.svn-base

    I.A...R       972  2020-12-11 15:40  WinformLog4\.svn\pristine\a3\a396b214e9cb0f968801342415a9299edf582f8d.svn-base

    I.A...R     19456  2020-12-11 15:40  WinformLog4\.svn\pristine\a3\a3dbc446621644cceb11b1bca2ba908ae0f08f8c.svn-base

............此处省略175个文件信息

评论

共有 条评论