XgSyslog


Defines

#define SYSLOG_MAXBUF   256
 Syslog message buffer size.

Functions

void closelog (void)
 Release system resources occupied by syslog().
void openlog (CONST char *ident, int logstat, int logfac)
 Open logging for specialized processing.
int setlogmask (int logmask)
 Set the log priority mask level.
u_long setlogserver (u_long ip, u_short port)
 Set the log server's IP address.
void syslog (int pri, CONST char *fmt,...)
 Print log message.
void vsyslog (int pri, CONST char *fmt, va_list ap)
 Print log message.


Function Documentation

void openlog ( CONST char *  ident,
int  logstat,
int  logfac 
)

Open logging for specialized processing.

This function provides for more specialized processing of the messages sent by syslog() and vsyslog().

Parameters:
ident This string that will be prepended to every message.
logstat A bit field specifying logging options, which is formed by OR'ing one or more of the following values:
  • LOG_CONS Ignored but accepted for compatibility.
  • LOG_NDELAY Ignored but accepted for compatibility.
  • LOG_PERROR Additionally write the message to standard error output.
  • LOG_PID Ignored but accepted for compatibility.
logfac Encodes a default facility to be assigned to all messages that do not have an explicit facility encoded:
  • LOG_AUTH The authorization system:
  • LOG_AUTHPRIV The same as LOG_AUTH.
  • LOG_CRON The cron daemon,
  • LOG_DAEMON System daemons, that are not provided for explicitly by other facilities.
  • LOG_FTP The file transfer protocol daemon,
  • LOG_KERN Messages generated by the kernel. These should not be generated by applications.
  • LOG_LPR The line printer spooling system.
  • LOG_MAIL The mail system.
  • LOG_NEWS The network news system.
  • LOG_SYSLOG Messages generated internally by syslog.
  • LOG_USER This is the default facility identifier if none is specified.
  • LOG_UUCP The UUCP system.
  • LOG_LOCAL0..LOG_LOCAL7 Reserved for local use.

int setlogmask ( int  logmask  ) 

Set the log priority mask level.

Calls to syslog() with a priority not set are ignored. The default allows all priorities to be logged.

Parameters:
logmask New priority mask.
Returns:
Previous mask.

u_long setlogserver ( u_long  ip,
u_short  port 
)

Set the log server's IP address.

Parameters:
ip IP address in network byte order. If 0, no messages will be sent out.
port Port number. If 0, then standard port is used.
Returns:
Previous IP.

void syslog ( int  pri,
CONST char *  fmt,
  ... 
)

Print log message.

The message is tagged with priority.

Parameters:
pri Priority level of this message, selected from the following ordered list (high to low):
  • LOG_EMERG A panic condition.
  • LOG_ALERT A condition that should be corrected immediately.
  • LOG_CRIT Critical conditions, e.g., hard device errors.
  • LOG_ERR Errors.
  • LOG_WARNING Warning messages.
  • LOG_NOTICE Conditions that are not error conditions, but should possibly be handled specially.
  • LOG_INFO Informational messages.
  • LOG_DEBUG Messages that contain information normally of use only when debugging a program.
fmt Format string containing conversion specifications like printf.

void vsyslog ( int  pri,
CONST char *  fmt,
va_list  ap 
)

Print log message.

Alternate form of syslog(), in which the arguments have already been captured using the variable-length argument facilities.

Parameters:
pri Priority level of this message. See syslog().
fmt Format string containing conversion specifications like printf.
ap List of arguments.


Generated on Tue Jan 23 21:12:31 2007 for BTnut System Software by doxygen 1.4.7