Logging thread and logging to file.