FIX #4712 - Exception on writing log

Fixing bug report #4712
Could also be merged into 3.3/master

~ Daniel