Relative filepath support for XMLFileErrorLog

154 views
Skip to first unread message

Brad Butts

unread,
Jul 30, 2007, 10:14:02 AM7/30/07
to ELMAH
It appears that only absolute filepaths are supported with the
XMLFileErrorLog provider. For example, this configuration works:
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="D:\elmah_logs\"/
>

However, I would expect this configuration to drop error files to the
sub-dir elmah_logs under my bin folder and it does not:
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="elmah_logs\"/>

Are there any plans to include this feature? One caveat here would be
to be sure to get the right filepath mapping to the physical location
of the virtual directory (eg. Server.MapPath) instead of the worker
process in system32.

Thanks!
Brad

Scott Wilson

unread,
Jul 30, 2007, 10:53:10 AM7/30/07
to el...@googlegroups.com
> It appears that only absolute filepaths are supported with the
> XMLFileErrorLog provider. For example, this configuration works:
> <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="D:\elmah_logs\"/
> >

There are a couple of reasons that I implemented this in this manner. I
think in general, it's bad practice to enable write permissions anywhere
within your web root. This essentially allows your error logs to be read
by folks who you don't want to be able to read these files.

Having the error repository inside your web root is also incompatible with
any sort of managed environment. I'm sure many people are happy editing
sites directly via ftp or a file share, but as soon as you move into
either a distributed environment with multiple servers or one with a
proper build and deployment system, you don't want anything in your web
root besides the website code.

Hope that helps... It's an easy tweak to make if it's something you really
want to have though.

Regards,

Scott


Reply all
Reply to author
Forward
0 new messages