How to log error info in asp.net app?

G

Guest

Hello, friends,

I deployed my asp.net app to our server. As I did in our client/sever C#.net
app, I wrote errors into a log file in catch{} block of try/catch statements,
espeically for those DB access errors.

However, in asp.net, it did not work. It said access denied when
creating/writing a log file.

I was not allowed to install .net studio in the server it either. Also, this
is a stand alone web server, no development machine connected to it.

This gave me BIG trouble since I really could not figure out what was wrong
without going through source code one line by one line using IDE or reading
detailed error info from a log file.

Any suggestions, reference papers? Help please. Thanks a lot.
 
G

Greg Burns

One quick solution would be to display your errors with Trace.Warn
statements.

Then just enable tracing in your web.config. Access your website with
http://mysite/trace.axd to see the trace info.

Myself, I record errors in the Application eventlog.

Greg
 
B

Bruce Barker

you need a directory you are allowed to write to. if you did not specify the
path of the log file, the default dir is the system32 dir, where you cannot
write to. you might want to put it in your vdir.

-- bruce (sqlwork.com)
 
J

Juan T. Llibre

re:
However, in asp.net, it did not work. It said access denied when
creating/writing a log file.

The account ASP.NET is running as must have write permission
to the event log.

You could also try logging to a text file.

re:
I was not allowed to install .net studio in the server it either.

You must install while logged in as an account with administrative privileges.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top