Max size of a string that can be logged in error log

Maxim Dounin mdounin at
Wed May 2 10:39:17 UTC 2012


On Tue, May 01, 2012 at 08:38:01AM -0700, Ashish S wrote:

> Is there a maximum size (and a corresponding tunable buffer size or
> so) for a string that can be logged in nginx Error log? I could find

The hard limit is in code, NGX_MAX_ERROR_STR which is defined to 
2048.  The limit is due to use of static buffer for logging 
errors, it's used to avoid allocations in error logging path (as 
allocation may fail, especially if we are trying to log allocation 

> the tunable for access log (buffer=size), but not for error log.

The access log line size isn't limited.  The buffer= argument is 
to reduce number of write() calls, which is helpfull in case of high 

Maxim Dounin

More information about the nginx mailing list