Add log4js config setting

Fix #916. Supersedes #1016.