Code Coverage by Clover.NET

 « Return to Thread: Changing FileName programmatically

Re: Changing FileName programmatically

by Segway Rod :: Rate this Message:

Reply to Author | View in Thread

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

 « Return to Thread: Changing FileName programmatically

LightInTheBox - Buy quality products at wholesale price