For some business purposes I have to create different log files and write them to different files. [1 to 1000 dynamically change] .It may be crazy but that is what the business wants.
I am able to manage it using NLog programatically : I create different Target for different log files programatically and create named loggers for each of them.
The problem is that now I am not able to configure NLog externally : Suppose that I will change log files layout. [ Now I should do it from code ] I should have to create my own config file which I do not want.
I try to write to use NConfig file variable definition, but NLog does not allow to reach variable definitions from code.
Is it possible [ any trick] to create loggers with different files with NLog Config file, without writing all logs-targets to NLog File? [ I am not able to add all loggers to Nlog config since I do not know how many I will create, but I have a pattern to create them ]
My Log File Creation Pattern :
I have different channels in my app : For each request I create a new channel with its own channel:
- Channel1.log Channel2.log Channel3.log .... ChannelN.log