Skahal.Infrastructure.Framework.Logging.ILogStrategy's implementations.
C#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore Initial commit Jun 4, 2014
.travis.yml
LICENSE
README.md Update README.md May 6, 2017

README.md

Skahal.Infrastructure.Logging

Skahal.Infrastructure.Framework.Logging.ILogStrategy's implementations.


Features

  • Log4net (Log4netLogStrategy)
  • Mono support
  • Fully tested on Windows and MacOSX
  • Tests coveraged
  • Good (and well used) design patterns

Setup

PM> Install-Package Skahal.Infrastructure.Logging.Log4net

Using Log4netLogStrategy

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.
}

Roadmap

  • Unity3d degug log: Unity3dLogStrategy

How to improve it?

Create a fork of Skahal.Infrastructure.Logging.

Did you change it? Submit a pull request.

License

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.

Change Log

  • 1.0.1 HelperSharp updated.
  • 0.5.0 First version.