one db - multiple websites?

788 views
Skip to first unread message

seanro...@googlemail.com

unread,
Jun 10, 2008, 6:50:24 AM6/10/08
to ELMAH
Hi

sorry if this has been asked before. Is it possible to use ELMAH on
multiple websites using a single database? These sites will be on the
same server.


thanks and regards
Sean

Atif Aziz

unread,
Jun 10, 2008, 7:21:17 AM6/10/08
to el...@googlegroups.com
>>
Is it possible to use ELMAH on
multiple websites using a single database? These sites will be on the
same server.
<<

Yes, there are two ways to achieve this:

1. You setup each application for ELMAH. This involves dropping the ELMAH binaries into the bin folder of each web site and then making the necessary changes to web.config.

2. You download the sources, strong-name the assembly by signing it (requires re-compilation) and then deploy it into the GAC. You then setup machine.config to enable ELMAH. Since that is inherited, all web site now and in the future will be using ELMAH without further ado.

In either case, you can setup a single SQL Server or Oracle database to log the errors. In case 1, you need to specify the same connection string in the configuration of each application. In case 2, you specify the connection string in the machine.config and this gets inherited by all web applications (with each application still having the option to override it).

Hope this helps,
- Atif

Jeff Schoolcraft

unread,
Jun 10, 2008, 8:00:12 AM6/10/08
to el...@googlegroups.com
Is there an easy way to distinguish between those multiple applications if they're on the same host?
--
Jeff Schoolcraft
http://thequeue.net/blog/
Microsoft MVP

Atif Aziz

unread,
Jun 10, 2008, 8:04:24 AM6/10/08
to el...@googlegroups.com

Is there an easy way to distinguish between those multiple applications if they're on the same host?

Yes, this is done automatically, but you can also set an application name in the web.config of each application. For example, if you’re using SqlErrorLog, the configuration entry would look like this:

 

<errorLog type="Elmah.SqlErrorLog, Elmah"

    connectionStringName="..."

    applicationName="WebApp1" />

 

- Atif

seanro...@googlemail.com

unread,
Jun 10, 2008, 8:28:00 AM6/10/08
to ELMAH
thanks!
Reply all
Reply to author
Forward
0 new messages