I traced this into the Apache source code (ver 2.4.4). It looks like the error message string is really limited by the size of 8KB.

This line is in server/log.c:1097

"
static void log_error_core(const char *file, int line, int module_index,
                           int level,
                           apr_status_t status, const server_rec *s,
                           const conn_rec *c,
                           const request_rec *r, apr_pool_t *pool,
                           const char *fmt, va_list args)
{
    char errstr[MAX_STRING_LEN];
"

"
And MAX_STRING_LEN is defined in include/httpd.h:298

/** The default string length */
#define MAX_STRING_LEN HUGE_STRING_LEN

/** The length of a Huge string */
#define HUGE_STRING_LEN 8192
"

I tried to increase this value, recompile, and apparently I got a longer message. Please correct me if I am wrong... If this is true then can anyone tell me why this "HUGE_STRING_LEN" value is a hard-coded value but not a configurable option ?

Cheers, Vu


On 03/13/2013 11:16 AM, Eric Covener wrote:
On Wed, Mar 13, 2013 at 6:01 AM, Hoang Vu Dang <dang....@gmail.com> wrote:
Hi guys,

Is there any limit of the size of a message log entry? How to control this ?

I did this:

ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, f->r,
                 "%s", buffer);

And the buffer was truncated on the error log. I check the strlen of the buffer 
and it was about 320K, and I got only around: ~ 8KB
If it's more than PIPE_BUF, it won't be atomic and can be interleaved
with other entries.  Are you sure it's truncated and not just spread
out?

Reply via email to