vsyslog(3C) Standard C Library Functions vsyslog(3C)NAME
vsyslog - log message with a stdarg argument list
SYNOPSIS
#include <syslog.h>
#include <stdarg.h>
int vsyslog(int priority, const char *message, va_list ap);
DESCRIPTION
The vsyslog() function is identical to syslog(3C), except that it is called with an argument list as defined by <stdarg.h> rather than with
a variable number of arguments.
EXAMPLES
Example 1: Use vsyslog() to write an error routine.
The following demonstrates how vsyslog() can be used to write an error routine.
#include <syslog.h>
#include <stdarg.h>
/*
* error should be called like:
* error(pri, function_name, format, arg1, arg2...);
*/
void
error(int pri, char *function_name, char *format, ...)
{
va_list args;
va_start(args, format);
/* log name of function causing error */
(void) syslog(pri, "ERROR in %s.", function_name);
/* log remainder of message */
(void) vsyslog(pri, format, args);
va_end(args);
(void) abort( );
}
main()
{
error(LOG_ERR, "main", "process %d is dying", getpid());
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO syslog(3C), attributes(5)SunOS 5.10 15 Nov 1999 vsyslog(3C)
Check Out this Related Man Page
vsyslog(3C) Standard C Library Functions vsyslog(3C)NAME
vsyslog - log message with a stdarg argument list
SYNOPSIS
#include <syslog.h>
#include <stdarg.h>
void vsyslog(int priority, const char *message, va_list ap);
DESCRIPTION
The vsyslog() function is identical to syslog(3C), except that it is called with an argument list as defined by <stdarg.h> rather than with
a variable number of arguments.
EXAMPLES
Example 1 Use vsyslog() to write an error routine.
The following example demonstrates the use of vsyslog() in writing an error routine.
#include <syslog.h>
#include <stdarg.h>
/*
* error should be called like:
* error(pri, function_name, format, arg1, arg2...);
*/
void
error(int pri, char *function_name, char *format, ...)
{
va_list args;
va_start(args, format);
/* log name of function causing error */
(void) syslog(pri, "ERROR in %s.", function_name);
/* log remainder of message */
(void) vsyslog(pri, format, args);
va_end(args);
(void) abort( );
}
main()
{
error(LOG_ERR, "main", "process %d is dying", getpid());
}
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO syslog(3C), attributes(5)SunOS 5.11 30 Aug 2006 vsyslog(3C)
Hi,
I am getting the following message in syslog.log file. Kindly let me know if this is a serious problem. If yes, what should i do in order to solve this.
Dec 26 16:17:11 matrixde EMS : ------ EMS Event Notification ------ Value: "CRITICAL (5)" for Resource: "/system/events/memory/8" ... (2 Replies)
Hi,
we are trying to enable auditing for few oracle 9i database. and right now it writies into adump directory. As adump can be read/write by oracle user so could it be possible to write into syslog while oracle keeps writing to adump .
thanks in advance.
Pk (2 Replies)
Hi,
Following error message apeared in the syslog.log file of our hps2_dc server.
Mar 10 17:22:12 hps2_dc vmunix: 0/4/0/0.1.3.255.14.1.0 sctl
Mar 10 17:22:31 hps2_dc vmunix: 0/4/0/0: Unable to access previously accessed device at nport ID 0x10300.
Could it be a hardware problem related... (4 Replies)
Using redhat 64 bit ver 6.2
I have simple c++ app that is trying to write to syslog like this: /*
try to write massage into linux log
*/
void foo::writeToSyslog()
{
openlog("testlogfoo", 0, 24);
// Send the message.
... (1 Reply)