Adding logfiles function