Forum Moderators: open

Message Too Old, No Replies

Error Logging

         

IntegrityWebDev

2:06 pm on Mar 24, 2010 (gmt 0)

10+ Year Member



I am working on a site where there have been some end users reporting errors...but of course they dont send the errors. Ideally I would like an email error report to go out whenever there is an error (when the page breaks) but I thought I'd start with an error log.

This is Godaddy Windows hosting.

I added this code:
<appSettings>
<add key="ErrorLoggingLogToFile" value="True" />
<add key="ErrorLoggingLogFile" value="Error.log" />
</appSettings>

to my web.config then purposefully through some bad code into my .cs file to check it. No error file written.

So I manually created and uploaded the Error.log file, added bad code again to throw the error. No luck. It's not writing to the file.

Any thoughts?

Thanks,
Chris

marcel

2:35 pm on Mar 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never used that method, preferring to use ELMAH [code.google.com]

But, I think you need to specify the full path for your log, ie:
<add key="ErrorLoggingLogFile" value="c:\Myfolder\Error.log" />

You can get the full path to your web application with the following:
Response.Write(System.Web.HttpContext.Current.Request.PhysicalPath)

IntegrityWebDev

2:59 pm on Mar 24, 2010 (gmt 0)

10+ Year Member



OK thanks Marcel...I will ook at that!

IntegrityWebDev

5:49 pm on Mar 24, 2010 (gmt 0)

10+ Year Member



Took a look at ELMAH...not sure if thats what I'm needing or not. I haven't looked into this before but I thought this would be simple...maybe not. Basically when I get a yellow .NET error screen I want to store the contents of that screen in a file.

marcel

7:24 pm on Mar 24, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Basically when I get a yellow .NET error screen I want to store the contents of that screen in a file.

ELMAH will do that for you, it stores the Yellow error screen information in a database, it will also email the errors to you. You can also view all errors via a web interface or via an RSS feed.

IntegrityWebDev

1:34 pm on Mar 29, 2010 (gmt 0)

10+ Year Member



Hi Marcel, thanks for your persistance. I was able to get ELMAH installed although I haven't played with it too much yet. I had a hard time finding a difinitive guide for getting it running but finally found this one: [itscodingtime.com...]
and I have it running. Now for some testing with it. Thanks!

IntegrityWebDev

7:20 pm on Mar 29, 2010 (gmt 0)

10+ Year Member



Maybe this needs to be another thread or posted somewhere else entirely? If so just let me know.

OK, I've worked with ELMAH all day but cannot get this programe working. There's not a lot of "plain-speak" documentation on this for those of us not highly familiar with ASP.NET but it looks like it would be extremely helpful if I can get it working.

The situation: I have a pretty big client form on a godaddy hosted site. I test and it works. Client tests and it works but visitors are getting hit and miss errors. So I need a way to track just what errors they are getting. After Marcels suggestion I try ELMAH.

1. Drop the DLL in the bin directory on the Godaddy server.
2. Adjust the Web.config per the examples that came with ELMAH.
3. Find the elmah.axd no problem...no errors showing.
4. Try to go to a non-existing page, thinking that will throw an error. I get no error in the axd file.
5. Try to add some errant code to the form I'm working on. I get a yellow screen but nothing logging to ELMAH.

Any thoughts? I can post the web.config if needed?