syslog
Description
The syslog procedure enables you to send diagnostic messages to the syslog facility. It creates a character string by formatting the supplied arguments according to the formatting commands in a format control string. The resulting character string is written to the system’s syslog.
The format control string controls the formation of the character string that is written to the system’s syslog facility. It consists of two types of information: actual content and format command characters. The format command characters are used to insert and format the supplied arguments. The number of format command characters in the format control string must match the number of supplied arguments. In other words, if there are three formatting commands in the format control string, then three function arguments are required. Otherwise, an error is generated.
Starting with version 7.0.0, as an alternate to the use of syslog() function in the policy, you can use the settings syslog_accept_format, syslog_reject_format, syslogsession_start_format, syslogsession_start_fail_format, and syslogsession_finished_format in the pb.settings file. These settings format syslog messages for Accept and Reject events, and the session events Start, Finish, and Start_Fail.
For more information about these settings, see Customized Syslog Formatting in the Endpoint Privilege Management for Unix and Linux Administration Guide.
For more information on format command characters, see Format Commands.
Not supported in Endpoint Privilege Management for Linux (EPM-L).
Syntax
syslog (controlstring [,expression1, …]);
Arguments
controlstring | Required. Character string that contains the control string that is used to generate the formatted string that is passed to the syslog facility |
expression1 … | Optional. Expressions to substitute into the formatted string |
Return Values
Because syslog is a procedure, no return value is set.
Example
In this example,
syslog ("System administrator Ids: %s %s %s", "Adm1", "Adm2", "Adm3");
the message
System Administrator Ids: Adm1 Adm2 Adm3
is written to syslog (the syslog daemon, typically syslogd, and Endpoint Privilege Management for Unix and Linux must be configured for this to work).
See Also
fprintf, print, printf, sprintf(), PowerBroker syslog setting