Ron--

I can address your question indirectly and anecdotally.

FWIW, we looked at logging to the file system on our web server.

The security implications of giving an application rights to write to disk
was major concern of our web server administration team.

Another important consideration was the fact that we use load-balancing with
N number of possible web servers. Do we centralize the log? If so, how? And
so on.

We then looked at logging to the database; but, as we know, such logging
will NOT work when the database is down. Redundant logging is possible in
log4net; but, failover is not (yet). 

In the end, we simply decided to write to the EventLog and we set SiteScope
(our web monitoring tool) to email events with Source=OurSite to an email
group. While I do not like the idea of relying on a tertiary system (namely,
the email system infrastructure), I can rest assured that the EventLog will
always be there for introspection. We have found this to be a quick, easy,
sufficient solution.

All that being said, I think one can use UNC paths with log4net, such as...

<!-- Sample UNC path: \\\\dor935482\\ArchiveTest\\DLSLOD.log -->

...so maybe that can be used? (I guess that only you will be able to know if
a UNC path will work in your current system configuration.)

HTH.

Thank you.

--Mark


-----Original Message-----
From: Ron Grabowski [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 24, 2004 10:39
To: [email protected]
Subject: Ability to use tilda (or relative path) when specifing output
file in config file for ASP.Net logging


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


**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please notify 
the system manager at postmaster at dor.state.ma.us.
**********************************************************************

Reply via email to