Only add file handler when running from command line