{"id":109,"date":"2011-05-27T15:19:32","date_gmt":"2011-05-27T15:19:32","guid":{"rendered":"http:\/\/craftydba.com\/?p=109"},"modified":"2024-02-17T14:26:56","modified_gmt":"2024-02-17T14:26:56","slug":"application-logging","status":"publish","type":"post","link":"https:\/\/craftydba.com\/?p=109","title":{"rendered":"Application Logging"},"content":{"rendered":"<p>Error handling and application logging are the most import tasks associated with programming that are over looked by many developers.<\/p>\n<p>After a program is released to the field, how do you know if it is performing as it should? Are there issues with the language execution (1-tier), with the database (2-tier) or with the middle-ware (3-tier) ? Many times, issues are only noticed and acted upon after several complaints have been issued.<\/p>\n<p>Here is a short list of why you should adding logging to all programs that you create.<\/p>\n<ol>\n<li>Traps program execution for tracing down coding causing the error.<\/li>\n<li>Traps error events for follow up by developers before users complain.<\/li>\n<li>If captured in <a href=\"http:\/\/en.wikipedia.org\/wiki\/Windows_Event_Log#Windows_Event_Log\">windows event log<\/a>, 3rd party tools can harvest logs to one central server.<\/li>\n<li>Dashboards created at the central server can show the heart beat of your whole infrastructure.<\/li>\n<\/ol>\n<p>In summary, adding application logging to your scripts will save you time in the long run when there are application, database, middle-ware or network issues plaguing your company.<\/p>\n<p>The table below has starter code that you can use in your next Visual Basic (VB) Script.<\/p>\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\" width=\"600\" align=\"left\">\n<tbody>\n<tr>\n<td style=\"border: thin solid gray;\"><a href=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/mod-app-logging.vbs_1.txt\">mod-app-logging.vbs<\/a><\/td>\n<td style=\"border: thin solid gray;\">Application Logging Class<\/td>\n<\/tr>\n<tr>\n<td style=\"border: thin solid gray;\"><a href=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/tst-app-logging.vbs_.txt\">tst-app-logging.vbs<\/a><\/td>\n<td style=\"border: thin solid gray;\">Test Program<\/td>\n<\/tr>\n<tr>\n<td style=\"border: thin solid gray;\"><a href=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/run-app-logging.cmd_.txt\">run-app-logging.cmd<\/a><\/td>\n<td style=\"border: thin solid gray;\">Batch Progam<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\nThis is the sample log file stored in the same directory as the VB Script.\n<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-183\" title=\"app-logs-ex1\" src=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex1-300x110.jpg\" alt=\"\" width=\"300\" height=\"110\" srcset=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex1-300x110.jpg 300w, https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex1.jpg 680w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\nThis picture shows the error message being captured in the windows event log.\n<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-184\" title=\"app-logs-ex1\" src=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex2-300x167.jpg\" alt=\"\" width=\"300\" height=\"167\" srcset=\"https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex2-300x167.jpg 300w, https:\/\/craftydba.com\/wp-content\/uploads\/2011\/05\/app-logs-ex2.jpg 751w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Error handling and application logging are the most import tasks associated with programming that are over looked by many developers. After a program is released to the field, how do you know if it is performing as it should? Are there issues with the language execution (1-tier), with the database (2-tier) or with the middle-ware (3-tier) ? Many times, issues are only noticed and acted upon after several complaints have been issued. Here is a short list of why you should adding logging to all programs that you create. Traps&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,12,15,10],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-other","tag-application-logging","tag-free-code","tag-john-f-miner-iii","tag-vbscript"],"_links":{"self":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=109"}],"version-history":[{"count":0,"href":"https:\/\/craftydba.com\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions"}],"wp:attachment":[{"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craftydba.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}