Mercurial > hg > nginx
comparison src/http/modules/ngx_http_log_module.c @ 4327:73d37e1ccb91
- Improved error message when parsing of the "buffer" parameter of the
"access_log" directive fails.
- Added a warning if "log_format" is used in contexts other than "http".
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 06 Dec 2011 21:07:10 +0000 |
parents | 08d8af70760c |
children | d620f497c50f |
comparison
equal
deleted
inserted
replaced
4326:7423800ef437 | 4327:73d37e1ccb91 |
---|---|
969 | 969 |
970 buf = ngx_parse_size(&name); | 970 buf = ngx_parse_size(&name); |
971 | 971 |
972 if (buf == NGX_ERROR) { | 972 if (buf == NGX_ERROR) { |
973 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 973 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
974 "invalid parameter \"%V\"", &value[3]); | 974 "invalid buffer value \"%V\"", &name); |
975 return NGX_CONF_ERROR; | 975 return NGX_CONF_ERROR; |
976 } | 976 } |
977 | 977 |
978 if (log->file->buffer && log->file->last - log->file->pos != buf) { | 978 if (log->file->buffer && log->file->last - log->file->pos != buf) { |
979 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 979 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1001 ngx_http_log_main_conf_t *lmcf = conf; | 1001 ngx_http_log_main_conf_t *lmcf = conf; |
1002 | 1002 |
1003 ngx_str_t *value; | 1003 ngx_str_t *value; |
1004 ngx_uint_t i; | 1004 ngx_uint_t i; |
1005 ngx_http_log_fmt_t *fmt; | 1005 ngx_http_log_fmt_t *fmt; |
1006 | |
1007 if (cf->cmd_type != NGX_HTTP_MAIN_CONF) { | |
1008 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
1009 "the \"log_format\" directive may be used " | |
1010 "only on \"http\" level"); | |
1011 } | |
1006 | 1012 |
1007 value = cf->args->elts; | 1013 value = cf->args->elts; |
1008 | 1014 |
1009 fmt = lmcf->formats.elts; | 1015 fmt = lmcf->formats.elts; |
1010 for (i = 0; i < lmcf->formats.nelts; i++) { | 1016 for (i = 0; i < lmcf->formats.nelts; i++) { |