c# - Logging IP Address in WCF Service -


i'm using nlog in wcf service , log caller ip-address.

i've tried using aspnet-layoutrenderers (${aspnet-request:servervariable=remote_host}, ${aspnet-request:servervariable=remote_addr}, no avail, internal nlog exception being thrown , no log file being generated.

is there way log ip address in wcf service, without needing pass parameter called method?

var msg = operationcontext.current           .incomingmessageproperties[remoteendpointmessageproperty.name] remoteendpointmessageproperty;  var address = msg.address; 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -