comparison src/core/ngx_log.c @ 489:549994537f15 NGINX_0_7_52

nginx 0.7.52 *) Feature: the first native Windows binary release. *) Bugfix: in processing HEAD method while caching. *) Bugfix: in processing the "If-Modified-Since", "If-Range", etc. client request header lines while caching. *) Bugfix: now the "Set-Cookie" and "P3P" header lines are hidden in cacheable responses. *) Bugfix: if nginx was built with the ngx_http_perl_module and with a perl which supports threads, then during a master process exit the message "panic: MUTEX_LOCK" might be issued. *) Bugfix: nginx could not be built --without-http-cache; the bug had appeared in 0.7.48. *) Bugfix: nginx could not be built on platforms different from i386, amd64, sparc, and ppc; the bug had appeared in 0.7.42.
author Igor Sysoev <http://sysoev.ru>
date Mon, 20 Apr 2009 00:00:00 +0400
parents 6866b490272e
children 392c16f2d858
comparison
equal deleted inserted replaced
488:eb4fdebda673 489:549994537f15
182 182
183 #endif 183 #endif
184 184
185 185
186 void 186 void
187 ngx_log_abort(ngx_err_t err, const char *text) 187 ngx_log_abort(ngx_err_t err, const char *text, void *param)
188 { 188 {
189 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err, text); 189 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err, text, param);
190 }
191
192
193 void ngx_cdecl
194 ngx_log_stderr(const char *fmt, ...)
195 {
196 u_char *p;
197 va_list args;
198 u_char errstr[NGX_MAX_ERROR_STR];
199
200 va_start(args, fmt);
201 p = ngx_vsnprintf(errstr, NGX_MAX_ERROR_STR, fmt, args);
202 va_end(args);
203
204 if (p > errstr + NGX_MAX_ERROR_STR - NGX_LINEFEED_SIZE) {
205 p = errstr + NGX_MAX_ERROR_STR - NGX_LINEFEED_SIZE;
206 }
207
208 ngx_linefeed(p);
209
210 (void) ngx_write_fd(ngx_stderr_fileno, errstr, p - errstr);
190 } 211 }
191 212
192 213
193 ngx_log_t * 214 ngx_log_t *
194 ngx_log_init(void) 215 ngx_log_init(void)
204 NGX_FILE_APPEND, 225 NGX_FILE_APPEND,
205 NGX_FILE_CREATE_OR_OPEN, 226 NGX_FILE_CREATE_OR_OPEN,
206 NGX_FILE_DEFAULT_ACCESS); 227 NGX_FILE_DEFAULT_ACCESS);
207 228
208 if (ngx_stderr.fd == NGX_INVALID_FILE) { 229 if (ngx_stderr.fd == NGX_INVALID_FILE) {
209 ngx_message_box("nginx", MB_OK, ngx_errno, 230 ngx_event_log(ngx_errno,
210 "Could not open error log file: " 231 "Could not open error log file: "
211 ngx_open_file_n " \"" NGX_ERROR_LOG_PATH "\" failed"); 232 ngx_open_file_n " \"" NGX_ERROR_LOG_PATH "\" failed");
212 return NULL; 233 return NULL;
213 } 234 }
214 235
215 #else 236 #else
216 237