Skip to content

Commit 768271c

Browse files
Refactor NLog configuration in Startup.cs
Removed commented-out code for NLog setup and simplified the handling of development environment logging. Retained the use of the developer exception page while eliminating unnecessary complexity related to loading different NLog configuration files and hidden assemblies.
1 parent 9cb5158 commit 768271c

1 file changed

Lines changed: 1 addition & 21 deletions

File tree

  • TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService

TransactionProcessing.SchedulerService/TransactionProcessing.SchedulerService/Startup.cs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,7 @@ public void Configure(IApplicationBuilder app,
7474
ConfigurationReader.Initialise(Startup.Configuration);
7575

7676
String nlogConfigFilename = "nlog.config";
77-
78-
//if (env.IsDevelopment())
79-
//{
80-
// app.UseDeveloperExceptionPage();
81-
// string directoryPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
82-
// LogManager.AddHiddenAssembly(Assembly.LoadFrom(Path.Combine(directoryPath, "Shared.dll")));
83-
84-
// var developmentNlogConfigFilename = "nlog.development.config";
85-
// if (File.Exists(Path.Combine(env.ContentRootPath, developmentNlogConfigFilename)))
86-
// {
87-
// nlogConfigFilename = developmentNlogConfigFilename;
88-
// }
89-
//}
90-
//else
91-
//{
92-
// LogManager.AddHiddenAssembly(Assembly.LoadFrom(Path.Combine(env.ContentRootPath, "Shared.dll")));
93-
//}
94-
95-
//loggerFactory.ConfigureNLog(Path.Combine(env.ContentRootPath, nlogConfigFilename));
96-
//loggerFactory.AddNLog();
97-
77+
9878
if (env.IsDevelopment())
9979
{
10080
app.UseDeveloperExceptionPage();

0 commit comments

Comments
 (0)