Log to a file if running from a JAR
Fix unused import warnings