Log site ID along with error?

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
5/14/2012 5:35:05 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Log site ID along with error?

I'm trying to chase down some errors that are repeatedly appearing in our log. Many of them are broken links, possibly because search engine bots are constantly crawling our ten sites. Would it be possible to add the site number to the errors that are logged, so it will be easier to track these errors down to the source, and add redirects as necessary? Sometimes I'll get lucky if it's a file with a path and I can see the site ID, but often it's just a page URL.

In the meantime I'm going to use a broken link checker and test all of our sites to see if I can get them all fixed up.

Thanks as always!
Jamie

5/15/2012 7:47:18 AM
Gravatar
Total Posts 18439

Re: Log site ID along with error?

Hi Jamie,

It would be a bad idea to try to do that becuase it would involve making a hit to the database to determine the site id during the logging event and that could potentially involve other errors while trying to log the original error and could also be a performance problem for general logging.

What I can do is add a config setting to make it log the full url instead of the relative url and then you would know by the url which site is logging the error (at least for logging events that occur when there is an httpcontext.request involved, not all events log an url)

You'll be able to add this to user.config:

<add key="LogFullUrls" value="true" />

This will be in the repository later today.

Best,

Joe

5/15/2012 9:55:44 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Log site ID along with error?

That'll be perfect Joe, thanks!

Jamie

You must sign in to post in the forums. This thread is closed to new posts.