Write logs to files.