Support specifying log formats
add negative test for log_format
Merge pull request #491

Resolves #391