views:

27

answers:

1

When I run a IIS site locally, all site failures (aspx compilation bugs, exceptions in code, etc) are logged to the system event log. I can check the event log to see the HTTP request path and the exception details.

When I run the site on a webhost, I don't have access to the event log. How can I get the same level of error information?

I should be using a logging provided that records exceptions to a database or something. But suppose that code doesn't even get a chance to run, perhaps because a DLL doesn't load. How could I get information about that failure?

+1  A: 

On logging: Did you look at log4net? It separates the action of logging from the medium log entries are written to. You can use a configuration file to direct log entries to a file or database when using the hosting service, while keeping logging to event log when developing.

On dealing with errors: For errors that occur once that application has started, you can use Application_Error to trap exceptions that otherwise aren't handled. If the application doesn't even start, and you don't have access to the event log, there may not be enough information for you to identify the root cause. It might be worthwhile to deploy locally, to a server or VM that has very little installed on it, to identify missing DLLs and similar issues.

Oren Trutner