Back to index

php5  5.3.10
Defines | Functions
syslog.h File Reference
#include <windows.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define WIN32_LEAN_AND_MEAN
#define LOG_EMERG   1
#define LOG_ALERT   1
#define LOG_CRIT   1
#define LOG_ERR   4
#define LOG_WARNING   5
#define LOG_NOTICE   6
#define LOG_INFO   6
#define LOG_DEBUG   6
#define LOG_PRIMASK   0x07
#define LOG_PRI(p)   ((p) & LOG_PRIMASK)
#define LOG_MAKEPRI(fac, pri)   (((fac) << 3) | (pri))
#define LOG_KERN   (0<<3)
#define LOG_USER   (1<<3)
#define LOG_MAIL   (2<<3)
#define LOG_DAEMON   (3<<3)
#define LOG_AUTH   (4<<3)
#define LOG_SYSLOG   (5<<3)
#define LOG_LPR   (6<<3)
#define LOG_NEWS   (7<<3)
#define LOG_UUCP   (8<<3)
#define LOG_CRON   (9<<3)
#define LOG_AUTHPRIV   (10<<3)
#define LOG_NFACILITIES   10
#define LOG_FACMASK   0x03f8
#define LOG_FAC(p)   (((p) & LOG_FACMASK) >> 3)
#define LOG_MASK(pri)   (1 << (pri))
#define LOG_UPTO(pri)   ((1 << ((pri)+1)) - 1)
#define LOG_PID   0x01 /* log the pid with each message */
#define LOG_CONS   0x02 /* log on the console if errors in sending */
#define LOG_ODELAY   0x04 /* delay open until first syslog() (default) */
#define LOG_NDELAY   0x08 /* don't delay open */
#define LOG_NOWAIT   0x10 /* don't wait for console forks: DEPRECATED */
#define LOG_PERROR   0x20 /* log to stderr as well */

Functions

void closelog (void)
void openlog (const char *, int, int)
void syslog (int, const char *,...)

Define Documentation

#define LOG_ALERT   1

Definition at line 27 of file syslog.h.

#define LOG_AUTH   (4<<3)

Definition at line 44 of file syslog.h.

#define LOG_AUTHPRIV   (10<<3)

Definition at line 50 of file syslog.h.

#define LOG_CONS   0x02 /* log on the console if errors in sending */

Definition at line 66 of file syslog.h.

#define LOG_CRIT   1

Definition at line 28 of file syslog.h.

#define LOG_CRON   (9<<3)

Definition at line 49 of file syslog.h.

#define LOG_DAEMON   (3<<3)

Definition at line 43 of file syslog.h.

#define LOG_DEBUG   6

Definition at line 33 of file syslog.h.

#define LOG_EMERG   1

Definition at line 26 of file syslog.h.

#define LOG_ERR   4

Definition at line 29 of file syslog.h.

#define LOG_FAC (   p)    (((p) & LOG_FACMASK) >> 3)

Definition at line 54 of file syslog.h.

#define LOG_FACMASK   0x03f8

Definition at line 53 of file syslog.h.

#define LOG_INFO   6

Definition at line 32 of file syslog.h.

#define LOG_KERN   (0<<3)

Definition at line 40 of file syslog.h.

#define LOG_LPR   (6<<3)

Definition at line 46 of file syslog.h.

#define LOG_MAIL   (2<<3)

Definition at line 42 of file syslog.h.

#define LOG_MAKEPRI (   fac,
  pri 
)    (((fac) << 3) | (pri))

Definition at line 38 of file syslog.h.

#define LOG_MASK (   pri)    (1 << (pri))

Definition at line 56 of file syslog.h.

#define LOG_NDELAY   0x08 /* don't delay open */

Definition at line 68 of file syslog.h.

#define LOG_NEWS   (7<<3)

Definition at line 47 of file syslog.h.

#define LOG_NFACILITIES   10

Definition at line 52 of file syslog.h.

#define LOG_NOTICE   6

Definition at line 31 of file syslog.h.

#define LOG_NOWAIT   0x10 /* don't wait for console forks: DEPRECATED */

Definition at line 69 of file syslog.h.

#define LOG_ODELAY   0x04 /* delay open until first syslog() (default) */

Definition at line 67 of file syslog.h.

#define LOG_PERROR   0x20 /* log to stderr as well */

Definition at line 70 of file syslog.h.

#define LOG_PID   0x01 /* log the pid with each message */

Definition at line 65 of file syslog.h.

#define LOG_PRI (   p)    ((p) & LOG_PRIMASK)

Definition at line 37 of file syslog.h.

#define LOG_PRIMASK   0x07

Definition at line 35 of file syslog.h.

#define LOG_SYSLOG   (5<<3)

Definition at line 45 of file syslog.h.

#define LOG_UPTO (   pri)    ((1 << ((pri)+1)) - 1)

Definition at line 57 of file syslog.h.

#define LOG_USER   (1<<3)

Definition at line 41 of file syslog.h.

#define LOG_UUCP   (8<<3)

Definition at line 48 of file syslog.h.

#define LOG_WARNING   5

Definition at line 30 of file syslog.h.

Definition at line 23 of file syslog.h.


Function Documentation

void closelog ( void  )

Definition at line 62 of file wsyslog.c.

{
       TSRMLS_FETCH();
       if (PW32G(log_source)) {
              DeregisterEventSource(PW32G(log_source));
              PW32G(log_source) = NULL;
       }
       if (PW32G(log_header)) {
              STR_FREE(PW32G(log_header));
              PW32G(log_header) = NULL;
       }
}

Here is the caller graph for this function:

void openlog ( const char *  ,
int  ,
int   
)

Definition at line 124 of file wsyslog.c.

{
       TSRMLS_FETCH();

       if (PW32G(log_source)) {
              closelog();
       }

       STR_FREE(PW32G(log_header));

       PW32G(log_source) = RegisterEventSource(NULL, "PHP-" PHP_VERSION);
       spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
}

Here is the call graph for this function:

Here is the caller graph for this function:

void syslog ( int  ,
const char *  ,
  ... 
)

Definition at line 81 of file wsyslog.c.

{
       va_list args;
       LPTSTR strs[2];
       unsigned short etype;
       char *tmp = NULL;
       DWORD evid;
       TSRMLS_FETCH();

       /* default event source */
       if (!PW32G(log_source))
              openlog("php", LOG_PID, LOG_SYSLOG);

       switch (priority) {                /* translate UNIX type into NT type */
              case LOG_ALERT:
                     etype = EVENTLOG_ERROR_TYPE;
                     evid = PHP_SYSLOG_ERROR_TYPE;
                     break;
              case LOG_INFO:
                     etype = EVENTLOG_INFORMATION_TYPE;
                     evid = PHP_SYSLOG_INFO_TYPE;
                     break;
              default:
                     etype = EVENTLOG_WARNING_TYPE;
                     evid = PHP_SYSLOG_WARNING_TYPE;
       }
       va_start(args, message);    /* initialize vararg mechanism */
       vspprintf(&tmp, 0, message, args); /* build message */
       strs[0] = PW32G(log_header);       /* write header */
       strs[1] = tmp;                            /* then the message */
       /* report the event */
       ReportEvent(PW32G(log_source), etype, (unsigned short) priority, evid, NULL, 2, 0, strs, NULL);
       va_end(args);
       efree(tmp);
}

Here is the call graph for this function:

Here is the caller graph for this function: