added log2file functionality