Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a log4net pattern for machineName [duplicate]

I'm having a hard time finding documentation on the various 'in the box' patterns like

%logger  
%level  
%timestamp  

There is of course the example page but I'm not sure that's the full list of options.

I also know that it's possible to MDC parameters out of the app to the logger, but that involves a code change which is a different beast than a config change.

Is there a %machineName option, or machineIP option? The issue is that we have all our servers in the web farm log into the same database log, and we're now thinking that a disproportionate number of messages are coming from one machine.

like image 373
Ralph Shillington Avatar asked Jun 17 '09 14:06

Ralph Shillington


2 Answers

What I did just stumble across is

<layout type="log4net.Layout.PatternLayout" value="${COMPUTERNAME}"/>

and that seems to be working --- wonder what the difference is between this and the other options suggested. like %property{log4net:HostName}

like image 154
Ralph Shillington Avatar answered Nov 10 '22 00:11

Ralph Shillington


%property{log4net:HostName}
like image 42
JC. Avatar answered Nov 09 '22 23:11

JC.