Stripping commands from log; preparing statements