NET Logging Library
Logging to a Web Service
Basic Tasks > Logging to a Web Service

The WebServiceTarget is used to log messages to a web service

It has these properties that can be configured:

 

 

//Example runtime configuration, can also use log.config, app.config, or web.config
Log.ResetConfiguration();   
WebServiceTarget target = new WebServiceTarget();     

target.Url = "http://localhost:2648/Service1.asmx";
target.WebMethodName = "HelloWorld";
target.Namespace = "Acme.BusinessLogic";
target.IsSoap11Request = true;

target.Parameters.Add("n1", "${message}");
target.Parameters.Add("n2", "${logger}");
target.Parameters.Add("n3", "${level}");

  
Log.Config.Targets.Add(target);

Log.Debug("This is a test");

 

All Parameters

${message}
${logger}
${level}
${logdate}
${lastlogtime}
${username}
${machinename}
${currentappdomain}
${assemblyname}
${namespace}
${methodname}
${filename}
${linenumber}
${processname}
${elapsedmilliseconds}
${elapsedseconds}
${callingmethod}
${additionaldata}
${binarydata}