log can be write to file or console via preference