'nlog moving log halfway through program execution

I have a program that does the following things

  1. Start program execution, log timestamp
  2. Read command line inputs and parses arguments
  3. Based on arguments, creates a new log in the desired directory
  4. Continues logging in desired directory

My issue is that the logs generated from step 1 are stored in a different file than those generated in step 4. Is there an easy way to move the log location during step 3 instead of creating a new log? Or is there any easy way to copy the contents of the first log into the second log? Or am I going about this all wrong and there's a cleaner way to do it?



Solution 1:[1]

I would suggest saving the execution timestamp to a variable and logging it once you have decided where you want your logs to be.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mike