ELMAH has a class for customize the error log. You only need to implementing this class like
public class YourErrorLog : SqlErrorLog
{
public override string ConnectionString
{
get
{
//return any connection string that you want
}
}
}
in this implementation, you can read any connection string that you want. Finally you can tell the ELMAH know about that ErrorLog by
<elmah>
<errorLog type="YourAssembly.YourErrorLog, YourAssembly" connectionStringName="elmah-sqlserver" />
</elmah>
You can see the details here
I also found out one example in your case here
Hope this help.