Sun Java System Web Proxy Server 4.0.11 NSAPI Developer's Guide

L

log_error

The log_error function creates an entry in an error log, recording the date and the severity of the error , and a specified message.

Syntax

int log_error(int degree, char *func, Session *sn, Request *rq, 
	char *fmt, ...);

Returns

0 if the log entry was created, or -1 if the log entry was not created.

Parameters

int degree specifies the severity of the error. This value must be one of the following constants:

LOG_WARN — warning LOG_MISCONFIG — Asyntax error or permission violation LOG_SECURITY — An authentication failure or 403 error from a hostLOG_FAILURE — An internal problemLOG_CATASTROPHE — A nonrecoverable server errorLOG_INFORM — An informational message

char *func is the name of the function where the error has occurred.

Session *sn identifies the Session structure.

Request *rq identifies the Request structure.

The Session and Request parameters are the same as the ones passed into your SAF.

char *fmt specifies the format for the printf function that delivers the message.

... represents a sequence of parameters for the printf function.

Example

log_error(LOG_WARN, "send-file", sn, rq,  
	"error opening buffer from %s (%s)"), path, system_errmsg(fd));

See Also

func_exec