Specifying path for flat file logging

Topics: Logging Application Block
Jan 21, 2007 at 11:46 AM
I'm currently using the logging block in a winforms application which will end up being put into the "program files" directory, this uses a couple of log files (error.log and trace.log) which are currently in the same directory as the application. In anticipation of some problems with vista and general user permissions, what I'd like to be able to do is to specify either a temporary location or better to specify a directory relative to the temp path (from using System.IO.Path.GetTempPath()).

Is there a simple way of doing this within the configuration file, or an easy way of achieving it in code ?


Jan 21, 2007 at 11:53 PM
There's no way of doing this without changing code - however it should be a relatively straightforward change. If it were me, I'd probably use environment variable names such as %TEMP% and add some code to resolve these before generating the file.