I am using NLog for logging purpose.
My code is as follows:
If you want to still be able to use the convenient GetCurrentClassLogger method, you can filter the log messages to go to the correct target by using the namespaces in your project as a filter.
Say you have namespaces which start with fooA and namespaces which start with fooB. Then your NLog.config file would look like this:
And in your code, you just add a logger in every class you want to log:
private static Logger logger = LogManager.GetCurrentClassLogger();
As long as your namespaces are consistent, the log messages will filter to the correct file and you get a nice little class tag in your log messages to tell you where the log event occurred.