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 program execution for tracing down coding causing the error.
- Traps error events for follow up by developers before users complain.
- If captured in windows event log, 3rd party tools can harvest logs to one central server.
- Dashboards created at the central server can show the heart beat of your whole infrastructure.
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.
The table below has starter code that you can use in your next Visual Basic (VB) Script.
|mod-app-logging.vbs||Application Logging Class|
This is the sample log file stored in the same directory as the VB Script.
This picture shows the error message being captured in the windows event log.