How do you log the machine name via log4net?

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.

Leave a Comment