--- httpd-2.2.22.original/modules/loggers/mod_log_config.c 2012-01-04 18:03:11.000000000 -0200 +++ httpd-2.2.22/modules/loggers/mod_log_config.c 2012-08-01 00:03:02.000000000 -0300 @@ -1120,6 +1120,21 @@ return err_string; } +static const char *ap_pstrftime(apr_pool_t *p, const char *format) { + size_t got, len = strlen(format) + 1; + const char *fp = strchr(format, '%'); + char *buf = NULL; + apr_time_exp_t strftime_tm; + apr_time_exp_lt(&strftime_tm, apr_time_now()); + while (NULL != fp) { + len += 10; + fp = strchr(fp + 1, '%'); + } + + buf = apr_palloc(p, len); + apr_strftime(buf, &got, len, format, &strftime_tm); + return buf; +} static const char *add_custom_log(cmd_parms *cmd, void *dummy, const char *fn, const char *fmt, const char *envclause) @@ -1142,7 +1157,7 @@ cls->condition_var = apr_pstrdup(cmd->pool, &envclause[4]); } - cls->fname = fn; + cls->fname = apr_pstrdup(cmd->pool,ap_pstrftime(cmd->pool, fn)); cls->format_string = fmt; if (fmt == NULL) { cls->format = NULL;