Skip to content

Instantly share code, notes, and snippets.

@kelumKP
Created February 28, 2021 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kelumKP/2d4285b87ba6926f02847f575f137713 to your computer and use it in GitHub Desktop.
Save kelumKP/2d4285b87ba6926f02847f575f137713 to your computer and use it in GitHub Desktop.
Sample Console Log App Program
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