Advantage Developer Zone

 
 
 

Advantage Server Error Log

Wednesday, September 05, 2007

The Advantage error log (ADS_ERR.ADT or ADS_ERR.DBF) contains useful information about errors which occur at the server. This information can be very useful in diagnosing problems that have occurred when your application is running. This tech tip provides some insight into what this error log contains and how it can benefit you.
 
Since the error log is stored on the server, it is not always available to end-users, which can make troubleshooting errors more difficult. Additionally, you may want to use some of the information contained in the error log within your application. In both cases, it is necessary to have access to the error log from a client machine. Fortunately there are several ways to accomplish this.
 

Reviewing the Advantage Error Log

Let’s begin by reviewing what the error log contains. Beginning with version 8.0 of Advantage the error log is now stored as an ADT File (ADS_ERR.adt). If the ADS_ERR.ADT file cannot be accessed, errors will be logged to the ADS_ERR.DBF file. The error log contains the following fields:

Field Name
Type
Description
Error_Number
Autoinc
Unique error number for each error that occurs. There is an index on this field to display errors in the order they occurred.
DateTime
Timestamp
Date and time the error occurred.
Thread_Num
Integer
The id of the thread where the error occurred.
Err_Class
Integer
This defines the general class of the error. For a complete list, refer to the Advantage Error Guide in the help file.
Error_Code
Integer
This is the specific error code that was returned. Information about specific error codes are available in the help file and the knowledgebase.
ADS_Source
Character
The name of the source file where the error occurred. Used by the Advantage R&D team to troubleshoot complex errors.
Src_Line
Integer
The source code line where the error occurred. Used by the Advantage R&D team to troubleshoot complex errors.
Cnnct_Num
Integer
The client connection number (NetWare connections only).
Cnnct_Name
Character
The name of the client who caused the error.
FileName
Character
The filename on which the error occurred.
ADS_Ver
Character
The version of the Advantage Server.
Environmnt
Character
The server environment where Advantage is running.
OS_Version
Character
The version of the operating system where Advantage is running.
HostName
Character
The name of the server where Advantage is running.
More_Info
Memo
Any additional information logged by the server (ADS_ERR.ADT only).


The error log default location varies by operating system:
  • Netware – the default is the root of the SYS volume
  • Windows – the default is the root of the C: drive
  • Linux – the default is /var/log/advantage
The error log can be configured to be stored in any directory on the server. This is done by modifying the ERROR_ASSERT_LOGS key in the ADS.cfg (NetWare) or ADS.conf (Linux). For Windows, it can be set using the Advantage Configuration Utility.
 

Accessing the Error Log Remotely

There are several ways to allow access to the Advantage Error Log from a remote computer. The easiest way is to simply share the location where the error log is stored. In this case, we recommend that you specify a path for the error log instead of using the default. Another approach is to create a server-side alias to the location of the error log. This eliminates the need to share the error log folder on the network and reduces the risk of granting access to server files.
Both of these access methods have several drawbacks. If the error log is contained in a path different from your application data or you are using a different alias, you will have to make a second connection from your application to open the error log. Even if the error log is in the same folder as the rest of your data, it may still require another connection if you are using DBFs with your application. Additionally, this allows users free access to all of the information contained in the error log.
 
Another approach is to create a view from within your data dictionary. This allows for a much greater level of control over access to the error log. The view within the dictionary can be created using the path to the error log file within the SQL statement. The following statement will create a view to the Advantage Error Log on a Windows server.
 
CREATE VIEW ErrorLog AS
BEGIN
  SELECT * FROM “C:\ADS_ERR.adt”
END;
 
Permissions can be set on the view to restrict specific users or groups from opening the view and prevent changes from being made to the error log through the view. You can also only show the pertinent fields from the error log.
 
Once again, using our Windows server as an example, the following view shows a limited number of fields from the view.
 
CREATE VIEW ErrorLog AS
BEGIN
  SELECT Error_Number, DateTime, Err_Class, Error_Code,
  Cnnct_Name, FileName, More_Info FROM “C:\ADS_ERR.adt”
END;
 

Summary

The Advantage Error Log is another resource for getting more information about database errors. Access to the error log is usually restricted to the server on which it resides, however, there are mechanisms to allow users access to the information contained in the error log.
 
Keep in mind that the error log may provide more information than end-users need. Therefore, we recommend that you carefully determine how much information your end-users are allowed to access from the error log. Us