Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
$4

Personal License with Source Code

1 site, unlimited servers No source distribution 6 months support
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Aug 26, 2011
    Last Update: Aug 25, 2011
  • Language: C#

Easy Log Library

Easy Log Library
Developed by jack8024, Released Aug 26, 2011

EasyLog is a simple logging tool for the .Net framework

C#

Tags: log

About EasyLog

EasyLog is a simple logging tool for for the .Net framework, and is designed to be easy to use, easy to configure and easy to extend.

Feature:

  1. Easy to use
  2. Easy to configure
  3. Easy to extend
  4. Configurable at runtime without modifying the application binary.
  5. Filter the message by level

1. Easy to Use
Code just like :

Log.Debug("Debug Message"); //write a debug level message
Log.Error("Error Message"); //write a error level message
Log.Error("Error Message", ex); //write a error level message and log the exception
Log.LogMessage("Error Message", Level.Error); //write a message with specipfy level
Log.LogMessage("Fatal Message", Level.Fatal, ex);//write a message with specipfy level and log the

2. Easy to Configurate
Default it is not need to configurate.
The default configuration is:
EasyLog.LogLevel is Error.
EasyLog.LogType is EasyLog.FileLog type.
EasyLog.FileLog.FilePathFormat is "~/log/{0:yyyy-MM-dd}.log", it will generate one log file per day.
EasyLog.FileLog.MaxLogLength is 10M, it will limit the content length to 10M.
It is suitable for deployment.
Below is equal configuration in application configuration file


    
    
    
    

    
    
    
    

3. Easy to Extend
See How to Extend it?

4. Configurable at runtime without modifying the application binary.
it use appSettings to store configuration in application configuration file. it is optional, you can change it.

5. Filter the message by level
level: DEBUG < INFO < WARN < ERROR < FATAL Default level is error, it will filter debug, info and warn level message.

6. How to Extend it?
it is easy to extend it, add a class that implemented the interface ILog, and configure it in the appSettings just like


Example usage:

using EasyLog;
using System.Collections.Specialized;
namespace EasyLogTest
{
    public class ConsoleLog : ILog
    {
        public void ConfigLogger(NameValueCollection properties)
        {

        }

        public void LogMessage(object message, Level level, Exception ex)
        {
            StringBuilder messageBuilder = new StringBuilder();
            FormatMessage(messageBuilder, message, level, ex);
            Console.Write(messageBuilder);
        }

        public void FormatMessage(StringBuilder builder, object message, Level level, Exception e)
        {
            builder.Append("\tConsoleLog ");
            builder.Append(DateTime.Now);
            builder.Append((" [" + level.ToString().ToUpper() + "] ").PadRight(9));
            builder.Append(message);

            if (e != null)
            {
                builder.Append(Environment.NewLine).Append(e.ToString());
            }
            builder.AppendLine();
        }        
    }
}

User Reviews

No reviews have been submitted yet.

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.