Mercurial > hg > nginx
comparison src/core/ngx_log.h @ 5702:777202558122
Added syslog support for error_log and access_log directives.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Mon, 12 May 2014 16:34:15 +0400 |
parents | e088695737c3 |
children | 09e734739e46 |
comparison
equal
deleted
inserted
replaced
5701:1209b8a7b077 | 5702:777202558122 |
---|---|
41 #define NGX_LOG_DEBUG_CONNECTION 0x80000000 | 41 #define NGX_LOG_DEBUG_CONNECTION 0x80000000 |
42 #define NGX_LOG_DEBUG_ALL 0x7ffffff0 | 42 #define NGX_LOG_DEBUG_ALL 0x7ffffff0 |
43 | 43 |
44 | 44 |
45 typedef u_char *(*ngx_log_handler_pt) (ngx_log_t *log, u_char *buf, size_t len); | 45 typedef u_char *(*ngx_log_handler_pt) (ngx_log_t *log, u_char *buf, size_t len); |
46 typedef void (*ngx_log_writer_pt) (ngx_log_t *log, ngx_uint_t level, | |
47 u_char *buf, size_t len); | |
46 | 48 |
47 | 49 |
48 struct ngx_log_s { | 50 struct ngx_log_s { |
49 ngx_uint_t log_level; | 51 ngx_uint_t log_level; |
50 ngx_open_file_t *file; | 52 ngx_open_file_t *file; |
51 | 53 |
52 ngx_atomic_uint_t connection; | 54 ngx_atomic_uint_t connection; |
53 | 55 |
54 ngx_log_handler_pt handler; | 56 ngx_log_handler_pt handler; |
55 void *data; | 57 void *data; |
58 | |
59 ngx_log_writer_pt writer; | |
60 void *wdata; | |
56 | 61 |
57 /* | 62 /* |
58 * we declare "action" as "char *" because the actions are usually | 63 * we declare "action" as "char *" because the actions are usually |
59 * the static strings and in the "u_char *" case we have to override | 64 * the static strings and in the "u_char *" case we have to override |
60 * their types all the time | 65 * their types all the time |
225 void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...); | 230 void ngx_cdecl ngx_log_abort(ngx_err_t err, const char *fmt, ...); |
226 void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...); | 231 void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...); |
227 u_char *ngx_log_errno(u_char *buf, u_char *last, ngx_err_t err); | 232 u_char *ngx_log_errno(u_char *buf, u_char *last, ngx_err_t err); |
228 ngx_int_t ngx_log_open_default(ngx_cycle_t *cycle); | 233 ngx_int_t ngx_log_open_default(ngx_cycle_t *cycle); |
229 ngx_int_t ngx_log_redirect_stderr(ngx_cycle_t *cycle); | 234 ngx_int_t ngx_log_redirect_stderr(ngx_cycle_t *cycle); |
235 ngx_log_t *ngx_log_get_file_log(ngx_log_t *head); | |
230 char *ngx_log_set_log(ngx_conf_t *cf, ngx_log_t **head); | 236 char *ngx_log_set_log(ngx_conf_t *cf, ngx_log_t **head); |
231 | 237 |
232 | 238 |
233 /* | 239 /* |
234 * ngx_write_stderr() cannot be implemented as macro, since | 240 * ngx_write_stderr() cannot be implemented as macro, since |