Fix #2409 - Limit log text to 4000 characters