{"id":32477,"date":"2018-04-24T19:39:43","date_gmt":"2018-04-24T16:39:43","guid":{"rendered":"https:\/\/www.altoros.com\/blog\/?p=32477"},"modified":"2018-05-03T14:34:03","modified_gmt":"2018-05-03T11:34:03","slug":"troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging","status":"publish","type":"post","link":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/","title":{"rendered":"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging"},"content":{"rendered":"<p>Using a debugger isn&#8217;t always the right pill to take. For instance, a debugger may suspend execution, thus reproducing not all the issues in effect. So, what are the options when you can&#8217;t fully rely on a debugger?<\/p>\n<p>In this blog post, we share our experience of troubleshooting .NET applications employing logs and custom log scopes collected and aggregated by Cloud Foundry. In addition, we overview how general and app-specific metrics\u2014such as requests per action, a number of concurrent threads, login attempts, etc.\u2014can help to enable preventive maintenance. Finally, you will learn what key steps one needs to follow to remotely debug an app.<\/p>\n<p>&nbsp;<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#Troubleshoot_using_only_logs\" >Troubleshoot using only logs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#Preventive_maintenance_with_metrics\" >Preventive maintenance with metrics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#Remote_debugging\" >Remote debugging<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#Want_details_Watch_the_videos\" >Want details? Watch the videos!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#Related_slides\" >Related slides<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#Further_reading\" >Further reading<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#About_the_expert\" >About the expert<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Troubleshoot_using_only_logs\"><\/span>Troubleshoot using only logs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/author\/siarhei-matsiukevich\/\" rel=\"noopener\" target=\"_blank\">Sergey Matyukevich<\/a> of Altoros was one of the speakers during Day 2 of the Cloud Foundry Summit 2018 in Boston. In his presentation, Sergey introduced attendees to debug .NET apps on Cloud Foundry by using logs and metrics.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/Cloud-Foundry-CF-Summit-2018-Boston-NET-Troubleshooting-Sergey-Matyukevich.jpg\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/Cloud-Foundry-CF-Summit-2018-Boston-NET-Troubleshooting-Sergey-Matyukevich.jpg\" alt=\"\" width=\"640\" class=\"aligncenter size-full wp-image-32481\" \/><\/a><\/center><\/p>\n<blockquote><p><em>&#8220;Any issue can be fully troubleshooted using only logs.&#8221; \u2014Sergey Matyukevich<\/em><\/p><\/blockquote>\n<p>To start off, Sergey explained that debugging often begins with reading through logs. Cloud applications typically emit log messages to <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">stdout<\/code> or <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">stderr<\/code>. Log messages are usually JSON objects that have a structured format like the example below.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n{\r\n        &quot;Msg&quot; : &quot;Request started&quot;,\r\n        &quot;Level&quot; : &quot;INFO&quot;,\r\n        &quot;RequestId&quot; : &quot;0c28701b-e4de-11e6-8936&quot;,\r\n        \u201cUserId\u201d : 345,\r\n        \u201cUrl\u201d : \u201c\/user-profile\/save\u201d,\r\n        \u201cRequestParameters\u201d : { \u201cName\u201d: \u201cuser1\u201d, \u201cAge\u201d: 22 }\r\n}\r\n<\/pre>\n<p>With Cloud Foundry, developers have the option to choose which log to use from <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">Console.Write()<\/code>, the simplest logging tool, to the already existing logging libraries like <a href=\"https:\/\/serilog.net\/\" rel=\"noopener\" target=\"_blank\">Serilog<\/a> or even custom logs.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/creating-custom-logging-middleware-cloud-foundry-summit-2018.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/creating-custom-logging-middleware-cloud-foundry-summit-2018-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32530\" \/><\/a><\/p>\n<p><small>An example of a customized log<\/small><\/center><\/p>\n<p>Sergey emphasized the importance of using <a href=\"https:\/\/docs.microsoft.com\/en-us\/aspnet\/core\/fundamentals\/logging\/?view=aspnetcore-2.1&#038;tabs=aspnetcore2x#log-scopes\" rel=\"noopener\" target=\"_blank\">log scopes<\/a> as they ensure a consistent logging format and allow for moving most of the logging code to specialized classes (filters, middleware, etc.). Each log message transparently receives the properties of all parent scopes attached to it.<\/p>\n<p>Custom log scopes can also be created to include specific data. Ideally, the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">RequestId<\/code>, <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">UserId<\/code>, and <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">ThreadId<\/code> fields should be logged, as well as the following one-off events:<\/p>\n<ul>\n<li>Request info (path, parameters, and query parameters)<\/li>\n<li>Exception info (exception type and stack trace)<\/li>\n<li>Database queries (query type, query text, table name, and parameters)<\/li>\n<li>External service requests (URL and parameters)<\/li>\n<li>Entry and exit to\/from major components and services<\/li>\n<\/ul>\n<p>Finally, with logs properly configured, you can start off troubleshooting some issue. One way to do so is to find the log line indicating an error. What one needs is to copy the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">RequestId<\/code> field and filter all logs with that value. Then, you analyze the request parameters and, if necessary, use it to reproduce the error.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Preventive_maintenance_with_metrics\"><\/span>Preventive maintenance with metrics<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>While logs are generally good for fixing issues, employing metrics can help to prevent errors from even occurring. According to Sergey, general metrics fall under two categories:<\/p>\n<ul>\n<li>Container metrics (CPU, memory, disk, etc.)<\/li>\n<li>Network metrics (requests, response, response time, etc.)<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/Cloud-Foundry-CF-Summit-2018-Boston-NET-Troubleshooting-Sergey-Matyukevich-2.jpg\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/Cloud-Foundry-CF-Summit-2018-Boston-NET-Troubleshooting-Sergey-Matyukevich-2.jpg\" alt=\"\" width=\"640\" class=\"aligncenter size-full wp-image-32503\" \/><\/a><\/p>\n<blockquote><p><em>&#8220;Logs are used for troubleshooting, but the main use case for using metrics is preventive maintenance.&#8221; \u2014Sergey Matyukevich<\/em><\/p><\/blockquote>\n<p>Aside from the general metrics mentioned, Sergey also pointed out the importance of monitoring such app-specific metrics as:<\/p>\n<ul>\n<li>Error number<\/li>\n<li>Requests per action<\/li>\n<li>Database requests (per table and per action)<\/li>\n<li>A number of concurrent threads<\/li>\n<li>Execution time (total and for database queries)<\/li>\n<li>Login attempts<\/li>\n<\/ul>\n<p>To get the most out of these metrics, alerts need to be configured, so that errors can be predicted and, more importantly, prevented.<\/p>\n<p>In any Cloud Foundry deployment, logs and metrics make the task of debugging easier. Tools like Logsearch or Kibana help to simplify the analysis of your logs and metrics. One may also utilize <a href=\"https:\/\/www.altoros.com\/heartbeat\" rel=\"noopener\" target=\"_blank\">Heartbeat<\/a>\u2014a full-stack monitoring tool that provides operators and developers with a <a href=\"https:\/\/www.altoros.com\/blog\/heartbeat-v1-0-provides-high-availability-for-full-stack-cloud-foundry-monitoring\/\">360-degree live view<\/a> on their Cloud Foundry deployments.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/monitoring-solutions-architecture-cloud-foundry-summit-2018.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/monitoring-solutions-architecture-cloud-foundry-summit-2018-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32528\" \/><\/a><small>How monitoring solutions measure metrics in Cloud Foundry<\/small><\/center><\/p>\n<p>Another tool to employ is <a href=\"https:\/\/network.pivotal.io\/products\/altoros-log-search\" rel=\"noopener\" target=\"_blank\">Altoros Log Search<\/a>, which extends the capabilities of the ELK stack  (Elasticsearch, Logstash, and Kibana) to enable centralized, role-based, and reliable management of system and application logs from a Cloud Foundry deployment. The solution comes with pre-built Kibana dashboards and Logstash parsing rules, as well as with index templates adapted specifically for Cloud Foundry.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Remote_debugging\"><\/span>Remote debugging<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Sergey also outlined some key steps to take to remotely debug a .NET app on Cloud Foundry.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/remote-debugging-of-net-app-on-cloud-foundry-summit-2018.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/remote-debugging-of-net-app-on-cloud-foundry-summit-2018-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32522\" \/><\/a><\/center><\/p>\n<p>The first thing to do is to launch <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">vsdbg<\/code> (the .NET Core command line debugger) inside <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">vscode<\/code> (Visual Studio Code\u2014Microsoft&#8217;s source code editor) and configure the debugger using a JSON file.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/launching-json-file-to-remotely-debug-net-app-cloud-foundry-summit-2018.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/launching-json-file-to-remotely-debug-net-app-cloud-foundry-summit-2018-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32520\" \/><\/a><\/center><\/p>\n<p>Then, one needs to dockerize an app, with <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">vsdbg<\/code> up and running inside a Docker container.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/dockerizing-net-app-cloud-foundry-summit-2018.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/dockerizing-net-app-cloud-foundry-summit-2018-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32519\" \/><\/a><\/center><\/p>\n<p>Using a Docker image, you push the application into Cloud Foundry by running the <code style=\"color: #222222; background-color: #e6e6e6; padding: 1px 2px;\">cf-push<\/code> command.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/pushing-net-app-to-cloud-foundry.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/pushing-net-app-to-cloud-foundry-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32521\" \/><\/a><\/center><\/p>\n<p>On pushing the app, we can finally choose a process we want to debug. To initiate remote debugging on Windows, you deploy a \u201cdebugger\u201d virtual machine in Cloud Foundry&#8217;s internal network and employ the Remote Desktop Protocol to connect to a Diego cell and attach the debugger to a running process.<\/p>\n<p><center><a href=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/choosing-a-process-todebug-cloud-foundry-summit-2018.png\"><img decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/choosing-a-process-todebug-cloud-foundry-summit-2018-1024x576.png\" alt=\"\" width=\"640\" class=\"aligncenter size-large wp-image-32518\" \/><\/a><\/center><\/p>\n<p>Sergey warned the attendees not to overuse remote debugging. For instance, he noted that a need to remotely debug in production might indicate a problem with the application logging architecture. Sergey also stressed that not all the issues can be resolved with remote debugging, for example:<\/p>\n<ul>\n<li>Remote debugging is useless for post issues.<\/li>\n<li>Remote debugging suspends execution, that\u2019s why not all issues are reproducible under a debugger.<\/li>\n<\/ul>\n<p>You can find the source code of a sample .NET app troubleshooted and remotely debugged on Cloud Foundry in <a href=\"https:\/\/github.com\/s-matyukevich\/cf-summit-2018\/tree\/master\/dotnet-sample-app\" rel=\"noopener\" target=\"_blank\">this GitHub repo<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Want_details_Watch_the_videos\"><\/span>Want details? Watch the videos!<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<table width=\"100%\">\n<tbody>\n<tr>\n<td>\n<div style=\"float:right; width:50%; padding-left:15px; font-size:14px;\">\n<strong>Table of contents<\/strong><\/p>\n<ol>\n<li style=\"margin-bottom: 16px;\">How do .NET applications generate logs? (1:48)<\/li>\n<li style=\"margin-bottom: 16px;\">How are custom logging middleware created? (5:25)<\/li>\n<li style=\"margin-bottom: 16px;\">How do scopes help with logging? (6:14)<\/li>\n<li style=\"margin-bottom: 16px;\">What fields and events should be logged? (7:15)<\/li>\n<li style=\"margin-bottom: 16px;\">Looking for errors using logs (11:39)<\/li>\n<li style=\"margin-bottom: 16px;\">How do .NET applications utilize metrics? (13:10)<\/li>\n<li style=\"margin-bottom: 16px;\">How do monitoring solutions work with Cloud Foundry? (15:26)<\/li>\n<li style=\"margin-bottom: 16px;\">Setting up alerts with metrics (17:00)<\/li>\n<li style=\"margin-bottom: 16px;\">Remote debugging .NET applications (19:27)<\/li>\n<li style=\"margin-bottom: 16px;\">Remote debugging on Windows (23:20)<\/li>\n<\/ol>\n<\/div>\n<div class=\"video-container\"><iframe loading=\"lazy\" title=\"Troubleshooting .NET Apps on Cloud Foundry - Matyukevich Sergey, Altoros\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/ZUGNrwxtyaE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In this next video, <a href=\"https:\/\/www.linkedin.com\/in\/brownz\/\" rel=\"noopener\" target=\"_blank\">Zach Brown<\/a> of Pivotal and Sergey Matyukevich of Altoros provide a brief introduction into a cloud-native .NET track.<\/p>\n<p><center><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/Rw5vzeyrvws\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/center><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Related_slides\"><\/span>Related slides<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><center><iframe loading=\"lazy\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/key\/sext1QDPbVA9SC\" width=\"595\" height=\"485\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;\" allowfullscreen><\/iframe><\/center><\/p>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Further_reading\"><\/span>Further reading<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/cloud-foundry-deployment-metrics-that-matter-most\/\">Cloud Foundry Deployment Metrics That Matter Most<\/a><\/li>\n<li><a href=\"https:\/\/www.altoros.com\/blog\/using-centralized-logs-and-metrics-to-monitor-cloud-foundry-across-all-levels\/\">Using Centralized Logs and Metrics to Monitor Cloud Foundry Across All Levels<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span class=\"ez-toc-section\" id=\"About_the_expert\"><\/span>About the expert<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div>\n<div style=\"float: right;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2016\/06\/Sergey-Matyukevich-Cloud-Engineer-Altoros.png\" alt=\"\" width=\"150\" height=\"150\" class=\"aligncenter size-full wp-image-14918\" \/><\/div>\n<div style=\"width: 600px;\"><small><b>Sergey Matyukevich<\/b> is a Solutions Architect at Altoros. With 10 years in software engineering, he is an expert in cloud automation and designing architectures for complex cloud-based systems. An active member of the Go community and a frequent contributor to open-source projects (Ubuntu, Juju Charms, etc.), Sergey has authored a series of popular blog posts on <a href=\"https:\/\/www.altoros.com\/blog\/golang-internals-part-1-main-concepts-and-project-structure\/\">Golang internals<\/a>. He has also designed and delivered a range of training courses on Cloud Foundry and cloud-native development for DevOps engineers, software developers, and architects.<\/small><\/div>\n<\/div>\n<hr \/>\n<p><center><small>This post was written by <a href=\"https:\/\/www.altoros.com\/blog\/author\/carlo\/\">Carlo Gutierrez<\/a> with assistance from Sergey Matyukevich and <a href=\"https:\/\/www.altoros.com\/blog\/author\/sophie.turol\/\">Sophie Turol<\/a>.<\/small><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using a debugger isn&#8217;t always the right pill to take. For instance, a debugger may suspend execution, thus reproducing not all the issues in effect. So, what are the options when you can&#8217;t fully rely on a debugger?<\/p>\n<p>In this blog post, we share our experience of troubleshooting .NET applications employing [&#8230;]<\/p>\n","protected":false},"author":32,"featured_media":32527,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[7],"tags":[208,873,865,206],"class_list":["post-32477","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news-and-opinion","tag-cf-summit","tag-cloud-native","tag-heartbeat","tag-oss-cloud-foundry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging | Altoros<\/title>\n<meta name=\"description\" content=\"When you can\u2019t use a debugger to troubleshoot issues for some reasons, you may employ logs and metrics to find out what went wrong.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging | Altoros\" \/>\n<meta property=\"og:description\" content=\"Using a debugger isn&#8217;t always the right pill to take. For instance, a debugger may suspend execution, thus reproducing not all the issues in effect. So, what are the options when you can&#8217;t fully rely on a debugger? In this blog post, we share our experience of troubleshooting .NET applications employing [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/\" \/>\n<meta property=\"og:site_name\" content=\"Altoros\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-24T16:39:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-05-03T11:34:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"360\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Carlo Gutierrez\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carlo Gutierrez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/\",\"name\":\"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging | Altoros\",\"isPartOf\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif\",\"datePublished\":\"2018-04-24T16:39:43+00:00\",\"dateModified\":\"2018-05-03T11:34:03+00:00\",\"author\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/833e109f77de753b2b472dca0236b442\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#primaryimage\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif\",\"width\":640,\"height\":360},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.altoros.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#website\",\"url\":\"https:\/\/www.altoros.com\/blog\/\",\"name\":\"Altoros\",\"description\":\"Insight\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.altoros.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/833e109f77de753b2b472dca0236b442\",\"name\":\"Carlo Gutierrez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2021\/02\/CG_portrait-2-96x96.jpg\",\"contentUrl\":\"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2021\/02\/CG_portrait-2-96x96.jpg\",\"caption\":\"Carlo Gutierrez\"},\"description\":\"Carlo Gutierrez is a Technical Writer at Altoros. As part of the editorial team, his focus has been on emerging technologies such as Cloud Foundry, Kubernetes, blockchain, and the Internet of Things. Prior to Altoros, he primarily wrote about enterprise and consumer technology. Carlo has over 12 years of experience in the publishing industry. Previously, he served as an Editor for PC World Philippines and Questex Asia, as well as a Designer for Tropa Entertainment.\",\"url\":\"https:\/\/www.altoros.com\/blog\/author\/carlo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging | Altoros","description":"When you can\u2019t use a debugger to troubleshoot issues for some reasons, you may employ logs and metrics to find out what went wrong.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/","og_locale":"en_US","og_type":"article","og_title":"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging | Altoros","og_description":"Using a debugger isn&#8217;t always the right pill to take. For instance, a debugger may suspend execution, thus reproducing not all the issues in effect. So, what are the options when you can&#8217;t fully rely on a debugger? In this blog post, we share our experience of troubleshooting .NET applications employing [...]","og_url":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/","og_site_name":"Altoros","article_published_time":"2018-04-24T16:39:43+00:00","article_modified_time":"2018-05-03T11:34:03+00:00","og_image":[{"width":640,"height":360,"url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif","type":"image\/gif"}],"author":"Carlo Gutierrez","twitter_misc":{"Written by":"Carlo Gutierrez","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/","url":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/","name":"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging | Altoros","isPartOf":{"@id":"https:\/\/www.altoros.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#primaryimage"},"image":{"@id":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#primaryimage"},"thumbnailUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif","datePublished":"2018-04-24T16:39:43+00:00","dateModified":"2018-05-03T11:34:03+00:00","author":{"@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/833e109f77de753b2b472dca0236b442"},"breadcrumb":{"@id":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#primaryimage","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2018\/04\/using-logs-and-metrics-to-troubleshoot-net-app-on-cloud-foundry-v2.gif","width":640,"height":360},{"@type":"BreadcrumbList","@id":"https:\/\/www.altoros.com\/blog\/troubleshooting-net-apps-on-cloud-foundry-logs-metrics-and-remote-debugging\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.altoros.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Troubleshooting .NET Apps on Cloud Foundry: Logs, Metrics, and Remote Debugging"}]},{"@type":"WebSite","@id":"https:\/\/www.altoros.com\/blog\/#website","url":"https:\/\/www.altoros.com\/blog\/","name":"Altoros","description":"Insight","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.altoros.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/833e109f77de753b2b472dca0236b442","name":"Carlo Gutierrez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.altoros.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2021\/02\/CG_portrait-2-96x96.jpg","contentUrl":"https:\/\/www.altoros.com\/blog\/wp-content\/uploads\/2021\/02\/CG_portrait-2-96x96.jpg","caption":"Carlo Gutierrez"},"description":"Carlo Gutierrez is a Technical Writer at Altoros. As part of the editorial team, his focus has been on emerging technologies such as Cloud Foundry, Kubernetes, blockchain, and the Internet of Things. Prior to Altoros, he primarily wrote about enterprise and consumer technology. Carlo has over 12 years of experience in the publishing industry. Previously, he served as an Editor for PC World Philippines and Questex Asia, as well as a Designer for Tropa Entertainment.","url":"https:\/\/www.altoros.com\/blog\/author\/carlo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/32477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/comments?post=32477"}],"version-history":[{"count":62,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/32477\/revisions"}],"predecessor-version":[{"id":32837,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/posts\/32477\/revisions\/32837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media\/32527"}],"wp:attachment":[{"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/media?parent=32477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/categories?post=32477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.altoros.com\/blog\/wp-json\/wp\/v2\/tags?post=32477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}