How to log to a file without using third party logger in .Net Core? : <p>How to log to a file <strong>without</strong> using third party logger <em>(serilog, elmah etc.)</em> in <strong>.NET CORE</strong>?</p>

<pre><code>public void ConfigureServices(IServiceCollection services)
{
    services.AddLogging();
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    loggerFactory.AddConsole(Configuration.GetSection("Logging"));
    loggerFactory.AddDebug();
}
</code></pre>
