I made a change to log4net
code which I thought I'd share:
In "FileAppender.ConvertToFullPath(string
path)" I added "path = Environment.ExpandEnvironmentVariables(path);"
which enables the use of environment variables in the File attribute when
configuring file appenders.
Here is the new method body:
protected static string
ConvertToFullPath(string path)
{
if (path == null)
{
throw new ArgumentNullException("path");
}
{
if (path == null)
{
throw new ArgumentNullException("path");
}
// Added:
expand environment variables in path names
path = Environment.ExpandEnvironmentVariables(path);
path = Environment.ExpandEnvironmentVariables(path);
if
(SystemInfo.ApplicationBaseDirectory !=
null)
{
// Note that Path.Combine will return the second path if it is rooted
return Path.GetFullPath(Path.Combine(SystemInfo.ApplicationBaseDirectory, path));
}
return Path.GetFullPath(path);
}
Hope this helps.
{
// Note that Path.Combine will return the second path if it is rooted
return Path.GetFullPath(Path.Combine(SystemInfo.ApplicationBaseDirectory, path));
}
return Path.GetFullPath(path);
}
- Daniel Chait
--------
Daniel Chait
Lab49, Inc.
Phone: 212 966 3468 x112
Email: [EMAIL PROTECTED]
Web : www.lab49.com
Daniel Chait
Lab49, Inc.
Phone: 212 966 3468 x112
Email: [EMAIL PROTECTED]
Web : www.lab49.com
