comparison src/http/ngx_http_log_handler.c @ 178:a8ff48d26cca

nginx-0.0.1-2003-11-11-00:09:22 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 10 Nov 2003 21:09:22 +0000
parents 4db54fdbcbe7
children 8dee38ea9117
comparison
equal deleted inserted replaced
177:4db54fdbcbe7 178:a8ff48d26cca
208 } 208 }
209 209
210 210
211 static char *ngx_http_log_time(ngx_http_request_t *r, char *buf, uintptr_t data) 211 static char *ngx_http_log_time(ngx_http_request_t *r, char *buf, uintptr_t data)
212 { 212 {
213 return ngx_cpymem(buf, ngx_cached_http_log_time.data,
214 ngx_cached_http_log_time.len);
215
216 #if 0
213 ngx_tm_t tm; 217 ngx_tm_t tm;
214 218
215 ngx_localtime(&tm); 219 ngx_localtime(&tm);
216 220
217 return buf + ngx_snprintf(buf, sizeof("28/Sep/1970:12:00:00"), 221 return buf + ngx_snprintf(buf, sizeof("28/Sep/1970:12:00:00"),
218 "%02d/%s/%d:%02d:%02d:%02d", 222 "%02d/%s/%d:%02d:%02d:%02d",
219 tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1], 223 tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],
220 tm.ngx_tm_year, 224 tm.ngx_tm_year,
221 tm.ngx_tm_hour, tm.ngx_tm_min, tm.ngx_tm_sec); 225 tm.ngx_tm_hour, tm.ngx_tm_min, tm.ngx_tm_sec);
226 #endif
222 } 227 }
223 228
224 229
225 static char *ngx_http_log_request(ngx_http_request_t *r, char *buf, 230 static char *ngx_http_log_request(ngx_http_request_t *r, char *buf,
226 uintptr_t data) 231 uintptr_t data)
235 240
236 241
237 static char *ngx_http_log_status(ngx_http_request_t *r, char *buf, 242 static char *ngx_http_log_status(ngx_http_request_t *r, char *buf,
238 uintptr_t data) 243 uintptr_t data)
239 { 244 {
240 return buf + ngx_snprintf(buf, 4, "%d", r->headers_out.status); 245 return buf + ngx_snprintf(buf, 4, "%d",
246 r->err_status ? r->err_status : r->headers_out.status);
241 } 247 }
242 248
243 249
244 static char *ngx_http_log_length(ngx_http_request_t *r, char *buf, 250 static char *ngx_http_log_length(ngx_http_request_t *r, char *buf,
245 uintptr_t data) 251 uintptr_t data)