[go: nahoru, domu]

Voting

: min(zero, seven)?
(Example: nine)

The Note You're Voting On

rcgraves+php at brandeis dot edu
24 years ago
For the-header-file-enabled:

man 3 syslog defines the priorities, but not the integer values. For that you'll need to read your system header file.

Let's suppose I want to log an informational message in the mail log (which happens to be true). The man page tells me I want LOG_MAIL|LOG_INFO. So I look in /usr/include/sys/syslog.h and find (this happens to be Linux, your system could be different):

#define LOG_INFO 6 /* informational */
#define LOG_MAIL (2<<3) /* mail system */

2<<3 means shift 3 bits left, which means multiply by 8. So I want 2*8 + 6 = 22. syslog(22,"this message will appear in the mail log"); And indeed it does.

<< Back to user notes page

To Top