https://github.com/mfarkan/log4netcustomlogger
This is simple way to use for log4net library :)
https://github.com/mfarkan/log4netcustomlogger
log4net
Last synced: 7 months ago
JSON representation
This is simple way to use for log4net library :)
- Host: GitHub
- URL: https://github.com/mfarkan/log4netcustomlogger
- Owner: mfarkan
- License: apache-2.0
- Created: 2018-07-10T18:46:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-19T06:49:44.000Z (about 7 years ago)
- Last Synced: 2024-12-27T12:11:58.307Z (over 1 year ago)
- Topics: log4net
- Language: C#
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to My Log4Net Library
I know this library almost doing nothing but it's helping me something ;)
[Log4net config file](https://github.com/mfarkan/Log4NetCustomLogger/blob/master/Log4NetCustomLogger/log4net.config)
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 ;
```c#
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 ) ;
```c#
//container Registration
container.Register(Component.For().ImplementedBy().LifestyleTransient());
var logfile = Path.Combine(CurrentDomain.BaseDirectory, "log4net.config");
Log4netLogger.Init(logfile);
```
```c#
//Using the library.
public class Sample
{
private readonly ILogger _logger;
public Sample(ILogger logger)
{
_logger=logger;
}
}
```