Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<ItemGroup>
<PackageReference Include="Lamar" Version="15.0.0" />
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

<ItemGroup>
<PackageReference Include="MediatR" Version="12.5.0" />
<PackageReference Include="SecurityService.Client" Version="2025.5.1" />
<PackageReference Include="Shared" Version="2025.6.2" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.1" />
<PackageReference Include="SecurityService.Client" Version="2025.7.1" />
<PackageReference Include="Shared" Version="2025.7.9" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ClientProxyBase" Version="2025.6.2" />
<PackageReference Include="ClientProxyBase" Version="2025.7.9" />
<PackageReference Include="Ductus.FluentDocker" Version="2.10.59" />
<PackageReference Include="EventStoreProjections" Version="2023.12.3" />
<PackageReference Include="MessagingService.IntegrationTesting.Helpers" Version="2025.3.1" />
<PackageReference Include="MessagingService.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
Expand All @@ -19,12 +19,12 @@
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="Reqnroll" Version="2.4.1" />
<PackageReference Include="Reqnroll.NUnit" Version="2.4.1" />
<PackageReference Include="SecurityService.Client" Version="2025.5.1" />
<PackageReference Include="SecurityService.IntegrationTesting.Helpers" Version="2025.5.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.6.2" />
<PackageReference Include="SecurityService.Client" Version="2025.7.1" />
<PackageReference Include="SecurityService.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="Shared.IntegrationTesting" Version="2025.7.9" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.7.1" />

<PackageReference Include="coverlet.collector" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.5.1" />
<PackageReference Include="TransactionProcessor.Client" Version="2025.7.1" />
<PackageReference Include="TransactionProcessor.IntegrationTesting.Helpers" Version="2025.7.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
34 changes: 29 additions & 5 deletions TransactionProcessorACL/Program.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Shared.Logger;
using Shared.Middleware;

namespace TransactionProcessorACL
{
using Lamar.Microsoft.DependencyInjection;
using NLog;
using NLog.Extensions.Logging;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Lamar.Microsoft.DependencyInjection;

[ExcludeFromCodeCoverage]
public class Program
Expand All @@ -31,9 +35,29 @@ public static IHostBuilder CreateHostBuilder(string[] args)
.AddJsonFile("hosting.development.json", optional: true)
.AddEnvironmentVariables().Build();

String contentRoot = Directory.GetCurrentDirectory();
String nlogConfigPath = Path.Combine(contentRoot, "nlog.config");

LogManager.Setup(b =>
{
b.SetupLogFactory(setup =>
{
setup.AddCallSiteHiddenAssembly(typeof(NlogLogger).Assembly);
setup.AddCallSiteHiddenAssembly(typeof(Shared.Logger.Logger).Assembly);
setup.AddCallSiteHiddenAssembly(typeof(TenantMiddleware).Assembly);
});
b.LoadConfigurationFromFile(nlogConfigPath);
});


IHostBuilder hostBuilder = Host.CreateDefaultBuilder(args);
hostBuilder.UseWindowsService();
hostBuilder.UseLamar();
hostBuilder.ConfigureLogging(logging => {
logging.AddConsole();
logging.AddNLog();

});
hostBuilder.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
Expand Down
34 changes: 12 additions & 22 deletions TransactionProcessorACL/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace TransactionProcessorACL
{
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Http;
using System.Reflection;
using Bootstrapper;
using BusinessLogic.RequestHandlers;
using BusinessLogic.Requests;
Expand All @@ -41,8 +37,13 @@ namespace TransactionProcessorACL
using Shared.Extensions;
using Shared.General;
using Shared.Logger;
using Shared.Middleware;
using Swashbuckle.AspNetCore.Filters;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Http;
using System.Reflection;
using TransactionProcessor.Client;
using ILogger = Microsoft.Extensions.Logging.ILogger;

Expand Down Expand Up @@ -85,28 +86,17 @@ public void ConfigureContainer(ServiceRegistry services)
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
{
String nlogConfigFilename = "nlog.config";

if (env.IsDevelopment())
{
var developmentNlogConfigFilename = "nlog.development.config";
if (File.Exists(Path.Combine(env.ContentRootPath, developmentNlogConfigFilename)))
{
nlogConfigFilename = developmentNlogConfigFilename;
}

{
app.UseDeveloperExceptionPage();
}

loggerFactory.ConfigureNLog(Path.Combine(env.ContentRootPath, nlogConfigFilename));
loggerFactory.AddNLog();


ILogger logger = loggerFactory.CreateLogger("TransactionProcessor");

Logger.Initialise(logger);

Startup.Configuration.LogConfiguration(Logger.LogWarning);

app.UseMiddleware<TenantMiddleware>();
app.AddRequestLogging();
app.AddResponseLogging();
app.AddExceptionHandler();
Expand Down
6 changes: 3 additions & 3 deletions TransactionProcessorACL/TransactionProcessorACL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="11.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.5.0" />
<PackageReference Include="Shared" Version="2025.6.2" />
<PackageReference Include="Shared.Results.Web" Version="2025.6.2" />
<PackageReference Include="Shared" Version="2025.7.9" />
<PackageReference Include="Shared.Results.Web" Version="2025.7.9" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.1.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.3" />
Expand Down
2 changes: 1 addition & 1 deletion TransactionProcessorACL/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<target name="asyncFile" xsi:type="AsyncWrapper">
<target name="logfile" xsi:type="File"
fileName="/home/txnproc/trace/transactionprocessoracl.log"
layout="${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} | ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
layout="${date:format=dd/MM/yyyy HH\:mm\:ss.ffff} | ${level} |${mdlc:CorrelationId:fallback=NO-ID}| ${callsite:className=true} | ${message} | ${exception:format=type,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method:InnerExceptionSeparator= | }"
archiveFileName="/home/txnproc/trace/transactionprocessoracl.{#####}.log"
archiveAboveSize="104857600"
archiveNumbering="Sequence"
Expand Down
Loading