RTEMS Logo

RTEMS 4.6.2 On-Line Library


Event Logging Manager log_write - Write to the system Log

PREV UP NEXT Bookshelf New Chapters

1.4.1: log_write - Write to the system Log

CALLING SEQUENCE:

#include <evlog.h>

int log_write(
  const log_facility_t  facility,
  const int             event_id,
  const log_severity_t  severity,
  const void           *buf,
  const size_t          len
);

STATUS CODES:

A successful call to log_write() returns a value of zero and an unsuccessful call returns the errno.

E2BIG
This error indicates an inconsistency in the implementation. Report this as a bug.
EINVAL
The facility argument is not a valid log facility.
EINVAL
The severity argument exceeds LOG_SEVERITY_MAX.
EINVAL
The len argument exceeds LOG_MAXIUM_BUFFER_SIZE.
EINVAL
The len argument was non-zero and buf is NULL.
ENOSPC
The device which contains the log file has run out of space.
EIO
An I/O error occurred in writing to the log file.

DESCRIPTION:

The log_write function writes an event record to the system log file. The event record written consists of the event attributes specified by the facility, event_id, and severity arguments as well as the data identified by the buf and len arguments. The fields of the event record structure to be written are filled in as follows:

log_recid
This is set to a monotonically increasing log record id maintained by the system for this individual log file.
log_size
This is set to the value of the len argument.
log_event_id
This is set to the value of the event_id argument.
log_facility
This is set to the value of the facility argument.
log_severity
This is set to the value of the severity argument.
log_uid
This is set to the value returned by geteuid().
log_gid
This is set to the value returned by getegid().
log_pid
This is set to the value returned by getpid().
log_pgrp
This is set to the value returned by getpgrp().
log_time
This is set to the value returned by clock_gettime() for the CLOCK_REALTIME clock source.

NOTES:

The _POSIX_LOGGING feature flag is defined to indicate this service is available.

This implementation can not return the EPERM error.


PREV UP NEXT Bookshelf New Chapters

Copyright © 1988-2004 OAR Corporation