Click here to Skip to main content
15,883,901 members
Articles / Programming Languages / C# 4.0

log4Net and SQLite

Rate me:
Please Sign up or sign in to vote.
3.64/5 (6 votes)
14 Jun 2012Apache3 min read 50.7K   16.2K   38  
This article explains how to work with log4Net and SQLite.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using log4net;

namespace log4NetExample
{
    public partial class log4netPage : System.Web.UI.Page
    {
        private static readonly ILog log = LogManager.GetLogger(typeof(log4netPage).FullName);
        protected void Page_Load(object sender, EventArgs e)
        {            
            Session["Usuario"] = "log4Net";
            log.Debug("Debug Message");
            log.Info("Debug Message");
            log.Warn("Debug Message");
            log.Fatal("Fatal error", new Exception("Fatal error generated"));
            log.Error("Error message", new Exception("Error message generated"));
            Response.Write("<H1>Log Generated Successfully...</H1>");
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Program Manager Grupo Leitz
Honduras Honduras
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions