<param name="File" value="Data/Logs/log.txt" />
<param name="File" value="../Data/Logs/log.txt" />
<param name="File" value="/Data/Logs/log.txt" />
will all work (the first one logs into a subdir of the current
directory named Data/Logs, the second into a sibling dir, the third
into a directory off the current drive's root).

I don't know of any way to put the current user's home directory in
there; you could try %USERPROFILE%/Data/Logs/log.txt if you're on
NT/2k/XP, or the tilde on *nix, but I don't know if those will work.

On Wed, 24 Nov 2004 07:38:33 -0800 (PST), Ron Grabowski
<[EMAIL PROTECTED]> wrote:
> On my dev machine, I have several appenders that write to various log
> files:
> 
> <param name="File"
> value="C:\\Inetpub\\wwwroot\\testsite\\Data\\Logs\\log.txt" />
> 
> When I move this to a different server, the file path won't always be
> C:\inetpub\wwwroot\testsite... Is there a way I can use a relative path
> on the param tag or on the log4net tag?
> 
> <param name="File" value="~/Data/Logs/log.txt" />
> 
> <log4net debug="true" BasePath="d:\\inetpub\\">
> 
> Its a pain having to make sure all the paths are correct (especially
> for long config files). Depending on the deployment environment, I may
> not know the true physical path unless I do some digging around.
> 
> I saw that Configure() has an overload that accepts a System.IO.Stream
> and/or XmlElement. I suppose I could load the file from disk, change
> the file paths dynmically, then send the config information to
> Configure(). Is there a better way?
> 
> - Ron
> 


-- 
Eric Means
[EMAIL PROTECTED]
http://www.randomtree.org/eric/

Reply via email to