Browse Prior Art Database

TraceLog API as a Useful Method for recording errors and doing debug in the field Disclosure Number: IPCOM000031557D
Original Publication Date: 2004-Sep-29
Included in the Prior Art Database: 2004-Sep-29
Document File: 3 page(s) / 91K

Publishing Venue



Production database programs usually fail because of bad expected data in the database. An SQL error may be thrown but it still takes sometime to determine the root cause of an SQL statement failure. Specifically what record or SELECT condition may be causing the problem. Logging of these failures at the time of failure is critical to resolving the problem.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 57% of the total text.

Page 1 of 3

TraceLog API as a Useful Method for recording errors and doing debug in the field

An application programming interface (API) was developed to address the problem of logging from the programmer's perspective. While this has been done many times before, the API described herein has a few unique features which may be patentable.

The primary features of the API are:

- to log errors and commentary based on tracing level - to capture key variable values - to substitute them into messages: errors, notes, traces - to execute code, commands, sql statements during program debug tracing - to selectively turn trace on/off in specific regions of the program - to split the log into separate daily executions so that older logs can be dropped on an as needed basis - to NLS enable the log output so that the end user can view it in one locale while support can view error messages in another locale

Errors are divided into 4 severity levels:

F - fatal error terminate program

E - error
W - Warning
I - Informational

Error messages are retrieved using an error message label identifier according to the locale. the error message label identifier follows the format of: AAA99999X where AAA is the program supplied error message prefix and 99999 is the error message number and the X is the severity level.

Trace levels:

0 - only errors and important commentary is logged 1 - tracing commentary is added to the log 2 - debug statements are executed and debug commentary is added to the log

The support analyst creates a properties file that is read by the program at startup, It indicates which sections should have tracing turned on ad what level of trace/debug is required.

The actual TraceLog API is shown below:

TraceLog API Method Arguments And Notes


Page 2 of 3

getTraceLevel none Get trace level: 0=no trace,

                                           1=trace on, 2=debug on setTraceLevel Int traceLevel = ( 0 | 1 | 2 ) See trace levels above addVar String varName

Object var

                                           Record the var for error or trace/debug conditions isTraceOn none Return true if traceLevel>0 isDebugOn none Return true if traceLevel >1 newLog String programName

Path to LOG directory

The program name is a unique identifier for the associated log files.

                                           Defaults are WCA for program name and C:\temp for log directory newTask String taskName - logs a task in the TOC

                                           - clears trace Var list newStep String stepName - logs a step in SystemLog newAction String actionName - logs action in SystemLog logError...