Is there any message template or other technique available to capture the client's IP address and print that in each log using log4net?
At this moment, I have the following conversion pattern for log4net
<conversionPattern value="%date [%thread] %level %logger - %message%newline%exception" />
So, I am not sure, if I simply add a placeholder for getting the IP address, Will log4bet magically know the client's IP address and print that?
OR do I need to configure my ASP.Net Core 3.1 website as well?
This is my current "CreateHostBuilder method.
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddLog4Net();
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
So, do I also need to make some changes to this method?

