Created
February 28, 2021 08:37
-
-
Save kelumKP/2d4285b87ba6926f02847f575f137713 to your computer and use it in GitHub Desktop.
Sample Console Log App Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Autofac; | |
using log4net; | |
using System.Diagnostics.CodeAnalysis; | |
namespace SampleConsoleLogApp | |
{ | |
[ExcludeFromCodeCoverage] | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CompositionRoot().Resolve<SampleInitialize>().Run(); | |
} | |
private static IContainer CompositionRoot() | |
{ | |
var builder = new ContainerBuilder(); | |
builder.RegisterType<SampleInitialize>().AsSelf(); | |
builder.RegisterInstance(LogManager.GetLogger("Logger")).As<ILog>(); | |
return builder.Build(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment