LogFormatEntry

LogFormatEntry formats a Log Entry for display.

Syntax
LogFormatEntry(service, pFormatEntry)

Parameters

 * service (ULONG) - input : The class of Logging Service:
 * Error logging
 * All other values are reserved for future use.


 * pFormatEntry (PVOID) - input : A pointer to the LogFormatEntry parameter packet.
 * For Error Logging, this is a pointer to a LFEREQUEST structure.

Returns

 * rc (APIRET) - returns : Return code.
 * LogFormatEntry returns the following values:
 * 0 No error
 * 2 Error file not found
 * 520 Error LF buf too small
 * 523 Error LF invalid service
 * 524 Error LF general failure
 * 1703 Invalid data pointer
 * 1701 Invalid LF log file id
 * 1702 Invalid LF packet revision number
 * 1706 Invalid LF parm packet ptr
 * 1751 Invalid LF flag
 * 1761 Error LF invalid packet size
 * 1770 Invalid log entry record
 * 1771 No log entry format template available
 * 2507 RAS unicode conversion error
 * 2600 RAS invalid locale object

ADDITIONAL RETURNS INFORMATION
The data will be passed back in multiple occurrences of the following LTD (Length, Type, Data) format: ULONG length ULONG type UniChar data[n] or Char data[n] Where:
 * length (ULONG) is the length, in bytes, of this detail record (includes length, type, and data fields).
 * type (ULONG) is an integer value that represents the type of data being passed back.

An error record is created by the system when an error in a system or application program triggers a probe in that program. Error records contain detailed information to help you diagnose the error. Error records are also called DET1 records. Records created by a back level logging system are called DET4 records.

A control record is created by the system when you make changes to the way errors are logged. For example, when you suspend error logging or direct error logging to a new file, the system records that change in a control record. Control records are also called DET2 records. Control records are new for FFST technology and are not available in records created by a back level logging system.

The following are the current Error Logging type values and their meanings: data (UniChar[]) or data (Char[]) is a variable length area that contains the formatted data.

Note: If there is no data, only the length and type portion of the record will be returned. The length would indicate that there is no data.

The library LFAPI.LIB must be linked with object files that use LogFormatEntry

The packet_revision_number parameter defines if pointers point to ASCII or UniCode character data.

Example Code

 * 1) define INCL_LOGGING
 * 2) include 
 * 3) include 

ULONG    service; PVOID    pFormatEntry; APIRET   rc;

rc = LogFormatEntry(service, pFormatEntry);  The following example formats an Error Log record for display. The calling program has placed the address of the locale object in locale.  #define INCL_LOGGING #include  #include   #include   #include 

{ APIRET rc;                              /* return code */ ULONG service; LFEREQUEST format_entry_packet; BYTE log_entry_buffer[1024]; UniChar string_buffer[4096]; #define STRING_BUFFER_LENGTH 4096 ULONG string_buffer_length; LocaleObject locale;

service = ERROR_LOGGING_SERVICE; string_buffer_length = STRING_BUFFER_LENGTH; rc = UniCreateLocaleObject(UNLUCS_STRING_POINTNER,(UniChar *) L"",&locale); if (rc |= 0) {    printf("UniCreateLocaleObject error: return code = %d",rc); return; }

/* Construct the Error Log Service format packet */ format_entry.packet.packet_size = sizeof(LFEREQUEST); format_entry_packet.packet_revision_number = WPOS_RELEASE_1; format_entry_packet.log_entry_buffer = &log_entry_buffer; format_entry_packet.flags = ERR_FORMAT_DETAIL_DATA; format_entry_packet.locale_object = locale; format_entry_packet.string_buffer_length = &string_buffer_length; format_entry_packet.string_buffer = &string_buffer; rc = LogFormatEntry(service,           /* service */              &format_entry_packet)   /* parameter packet */ if (rc |= 0) {    printf("LogFormatEntry error: return code = %d",rc); return; } 

Related

 * LogReadEntry