Added method to write log file

In log directory.