You can use the pre-populated property log4net:HostName
, for example:
<conversionPattern value="%property{log4net:HostName}" />
This way you don’t need to populate the MDC.
More Related Contents:
- Can you configure log4net in code instead of using a config file?
- Logger wrapper best practice
- How can I find the method that called the current method?
- How to print the current Stack Trace in .NET without any exception?
- Log4net rolling daily filename with date in the file name
- Write to Windows Application Event Log without event source registration
- Capture username with log4net
- Should I take ILogger, ILogger, ILoggerFactory or ILoggerProvider for a library?
- How do I do logging in C# without using 3rd party libraries? [closed]
- How performant is StackFrame?
- Log4Net Logging of two different levels to two different appenders for the same logger
- How I can set log4net to log my files into different folders each day?
- Why do loggers recommend using a logger per class?
- Can I get parameter names/values procedurally from the currently executing function?
- Enable file logging for log4net from code instead of from configuration
- How to log Trace messages with log4net?
- log4net: Configure to ignore messages from a specific class
- Logging to an individual log file for each individual thread
- Cursor.Current vs. this.Cursor
- ObserveOn and SubscribeOn – where the work is being done
- Convert from BitArray to Byte
- ASP.NET MVC Razor render without encoding
- Does the Enumerator of a Dictionary return key value pairs in the order they were added?
- EWS – Access All Shared Calendars
- DateTime.Parse(“2012-09-30T23:00:00.0000000Z”) always converts to DateTimeKind.Local
- Set Item Focus in ListView WPF
- GO statements blowing up sql execution in .NET
- How do I get a return value from Task.WaitAll() in a console app?
- Make a form’s background transparent
- .Net Excel Interop Deleting a worksheet