Skip to content

mfarkan/Log4NetCustomLogger

Repository files navigation

Welcome to My Log4Net Library

I know this library almost doing nothing but it's helping me something ;)

Log4net config file

It has ERROR,DEBUG,INFO,WARN level logging.

If you want to use this library for your solution or project just use CustomLog4netLibrary.dll

Here is the sample of using library ;

var logfile = Path.Combine(CurrentDomain.BaseDirectory, "log4net.config");
Log4NetLogger.Init(logfile);
Log4NetLogger log = new Log4NetLogger();
log.Log("this is a debug log...", LogType.Debug);

Sample with IoC Container ( Castle Windsor ) ;

//container Registration
container.Register(Component.For<ILogger>().ImplementedBy<Log4netLogger>().LifestyleTransient());
var logfile = Path.Combine(CurrentDomain.BaseDirectory, "log4net.config");
Log4netLogger.Init(logfile);
//Using the library.
public class Sample
{
  private readonly ILogger _logger;
	public Sample(ILogger logger)
	{
		_logger=logger;
	}
}

About

This is simple way to use for log4net library :)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages