escape log string to db