adding ability to force log flush