I am using NLog for logging purpose.
My code is as follows:
If you want a separate file to log information from another part of your program, you can add a logger and another target.
For example, if you have a program that is completing two different tasks and you want to log those tasks separately, you could do the following
Then, in your program, access them with:
var task1Logger = NLog.LogManager.GetLogger("task1Logger")
var task2Logger = NLog.LogManager.GetLogger("task2Logger")