Skahal.Infrastructure.Framework.Logging.ILogStrategy's implementations.
- Log4net (
Log4netLogStrategy
) - Mono support
- Fully tested on Windows and MacOSX
- Tests coveraged
- Good (and well used) design patterns
PM> Install-Package Skahal.Infrastructure.Logging.Log4net
Add log4net configuration to app.config/web.config. A basic configuration looks like:
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="Logs/log.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="100KB" />
<staticLogFileName value="true" />
<ImmediateFlush value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d{dd/MM/yy HH:mm:ss} [%level%] %m%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
</root>
</log4net>
In your app initialization, like global.asax, add:
protected void Application_Start()
{
LogService.Debug("Application starting...");
LogService.Debug("Machine: {0}", Environment.MachineName);
LogService.Initialize(new Log4netLogStrategy("App"));
LogService.Debug("Registering something...");
// your app initilization code.
}
- Unity3d degug log:
Unity3dLogStrategy
Create a fork of Skahal.Infrastructure.Logging.
Did you change it? Submit a pull request.
Licensed under the The MIT License (MIT). In others words, you can use this library for developement any kind of software: open source, commercial, proprietary and alien.
- 1.0.1 HelperSharp updated.
- 0.5.0 First version.