Skip to content

Instantly share code, notes, and snippets.

@AJGarrett
Created June 6, 2013 19:06
Show Gist options
  • Save AJGarrett/5724037 to your computer and use it in GitHub Desktop.
Save AJGarrett/5724037 to your computer and use it in GitHub Desktop.
Troubleshooting WebApi
Built a log function to turn off/on via web.config
<add key="logRequeststoDB" value="true" />
then add logger to the contoller functions as needed
example:
if (Convert.ToBoolean(ConfigurationManager.AppSettings["logRequeststoDB"].ToString()))
{
new ITEventLog("WebAPI", "Campus/Get?filtertype=" + filtertype + "&filter=" + filter + "&distance=" + distance.ToString()).Save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment