Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX SNAplus2 API NOF Programmer's Guide: HP-UX 11.0, 11i v1, and 11i v2 > Chapter 5 NOF API Verbs (REGISTER_INDICATION_SINK to UNREGISTER_INDICATION_SINK)

SET_LOG_FILE

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This verb manages a file that SNAplus2 uses to record log messages. It allows you to do the following:

  • Specify the file used to record log messages, and the backup file (to which log information is copied).

  • Specify the maximum log file size (when the log file reaches this size, SNAplus2 copies log information to the backup file and resets the log file).

  • Copy the current contents of the log file to the backup file, and optionally delete the current file.

You can record audit log and error log messages in separate files, or record both types of messages in the same file.

VCB Structure

typedef struct set_log_file
{
AP_UINT16 opcode; /* verb operation code */
unsigned char reserv2; /* reserved */
unsigned char format; /* reserved */
AP_UINT16 primary_rc; /* primary return code */
AP_UINT32 secondary_rc; /* secondary return code */
unsigned char log_file_type; /* type of log file */
unsigned char action; /* reset and/or backup existing */
unsigned char file_name[81]; /* file name */
unsigned char backup_file_name[81]; /* backup file */
AP_UINT32 file_size; /* log file size */
} SET_LOG_FILE;

Supplied Parameters

The application supplies the following parameters:

opcode

AP_SET_LOG_FILE

log_file_type

The type of log file being managed. Possible values are:

AP_AUDIT_FILE

Audit log file (audit messages only).

AP_ERROR_FILE

Error log file (problem and exception messages).

To record both types of messages in the same file, issue two SET_LOG_FILE verbs for the same file name, specifying AP_AUDIT_FILE on one verb and AP_ERROR_FILE on the other.

action

The action to be taken on the log file. Specify one of the following values:

AP_NO_FILE_ACTION

Use the file specified in the file_name parameter as the log file, and the file specified in the backup_file_name parameter as the backup file. After this verb completes successfully, all log messages of the type defined by log_file_type are written to the new log file. The log file that was used before this verb is issued, if any, is left unchanged.

AP_DELETE_FILE

Delete the contents of the current log file.

AP_BACKUP_FILE

Copy the contents of the current log file to the backup file, and then delete the contents of the current file.

file_name

Name of the new log file.

To create the file in the default directory for diagnostics files, /var/opt/sna, specify the file name with no path. To create the file in a different directory, specify either a full path or the path relative to the default directory. If you include the path, ensure that it is a valid path (either relative to the application's working directory or a full path) on any computer to which this verb is issued.

This parameter is an ASCII string of 1-80 characters, followed by a NULL character (binary zero). To continue logging to the file specified on a previous SET_LOG_FILE verb, specify a null string.

backup_file_name

Name of the backup log file. When the log file reaches the size specified by file_size below, SNAplus2 copies the current contents to the backup file and then clears the log file. You can also request a backup at any time using the action parameter above.

To create the file in the default directory for diagnostics files, /var/opt/sna, specify the file name with no path. To create the file in a different directory, specify either a full path or the path relative to the default directory. If you include the path, ensure that it is a valid path (either relative to the application's working directory or a full path) on any computer to which this verb is issued.

This parameter is an ASCII string of 1-80 characters, followed by a NULL character (binary zero). To continue using the backup file specified on a previous SET_LOG_FILE verb, specify a null string.

file_size

The maximum size of the log file specified by log_file_type. When a message written to the file causes the file size to exceed this limit, SNAplus2 copies the current contents of the log file to the backup log file and clears the log file. This means that the maximum amount of disk space taken up by log files is approximately twice file_size.

To continue using the file size specified on a previous SET_LOG_FILE verb, set this parameter to zero. The initial default value, before any SET_LOG_FILE verb has been issued, is 1,000,000 bytes. A value of zero indicates “continue using the existing file size” and not “no limit”.

You may need to increase the size of the log files according to the size of the SNAplus2 client-server network, to allow for the volume of log information generated in larger systems. In particular, consider increasing the log file size to allow for the following:

  • Large numbers of clients or users (since a single communications link failure may result in large numbers of logs on the server relating to session failures)

  • Activating audit logging as well as exception logging

  • Using central logging instead of distributed logging

  • Using full logging instead of succinct logging.

Returned Parameters: Successful Execution

If the verb executes successfully, SNAplus2 returns the following parameters:

primary_rc

AP_OK

secondary_rc

Not used.

Returned Parameters: Parameter Check

If the verb does not execute because of a parameter error, SNAplus2 returns the following parameters:

primary_rc

AP_PARAMETER_CHECK

secondary_rc

Possible values are:

AP_INVALID_FILE_ACTION

The action parameter was not set to a valid value.

AP_INVALID_FILE_TYPE

The log_file_type parameter was not set to a valid value.

Appendix A “Common Return Codes” lists further secondary return codes associated with AP_PARAMETER_CHECK, which are common to all NOF verbs.

Returned Parameters: Other Conditions

Appendix A “Common Return Codes” lists further combinations of primary and secondary return codes that are common to all NOF verbs.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2003 Hewlett-Packard Development Company, L.P.