Re: Changing FileName programmatically
I did it this way
config = new LoggingConfiguration();
FileTarget fileTarget = new FileTarget();
config.AddTarget("file", fileTarget);
fileTarget.Layout = "${longdate}|${level}|${callsite}|${message}";
fileTarget.FileName = String.Format("${{basedir}}/{0}.log", filename);
LoggingRule rule = new LoggingRule("*", LogLevel.Debug, fileTarget);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
where filename is passed into the method as a parameter
Hope this is what you're looking for
|