Created
September 1, 2015 13:33
-
-
Save vbilopav/e6139450da892a6956e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void LogRequest() | |
{ | |
if (OperationContext.Current == null) return; | |
string msg = String.Empty; | |
if (Properties.ContainsKey(RemoteEndpointMessageProperty.Name)) | |
{ | |
RemoteEndpointMessageProperty remote = | |
Properties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty; | |
if (remote != null) | |
msg = string.Format("request from [{0}]:{1}\n", remote.Address, remote.Port); | |
} | |
else | |
msg = "request from unknown source\n"; | |
msg = string.Concat(msg, Properties.ContainsKey("Encoder") ? | |
OperationContext.Current.RequestContext.RequestMessage.ToString() : | |
Properties.Via.ToString()); | |
Log.Info(msg); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment