You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Cheng <ch...@gmail.com> on 2006/05/09 20:01:48 UTC

how to get host name?

I am using AdoNetAppender. I want to log the name of the machine that
is running the application.

I tried following but doesn't work:
<parameter>
 <parameterName value="@p_ServerName" />
 <dbType value="String" />
 <size value="50" />
 <layout type="log4net.Layout.PatternLayout">
   <conversionPattern value="%property{log4net:HostName}" />
 </layout>
</parameter>

%p is interpreted as level, so what was logged into the database was:
DEBUGroperty{log4net:HostName}

so my question is what conversionPattern should I use to get host name?
and where can I see all the conversionPattern values available?