Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to catch Runtime errors and Log them on a ASP.NET project?

How to catch Runtime errors and Log them on a ASP.NET project?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorialquestion
7 Posts 5 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pubududilena
    wrote on last edited by
    #1

    Hi, We have developed website using ASP.NET,C#. But they are runtime errors and we got yellow pages. So How do we catch Runtime errors and Log them? please advice.

    E S N 3 Replies Last reply
    0
    • P pubududilena

      Hi, We have developed website using ASP.NET,C#. But they are runtime errors and we got yellow pages. So How do we catch Runtime errors and Log them? please advice.

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      Do you not run your application in a microsoft development package i.e. VWD ot VS, usually you can debug in that

      1 Reply Last reply
      0
      • P pubududilena

        Hi, We have developed website using ASP.NET,C#. But they are runtime errors and we got yellow pages. So How do we catch Runtime errors and Log them? please advice.

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        First you need to find which types of runtime error your website is getting if those are catchable put that code in try and catch block and Where do you want to logg that error ? are you guys are creating text files for logging

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        R 1 Reply Last reply
        0
        • S Sandeep Akhare

          First you need to find which types of runtime error your website is getting if those are catchable put that code in try and catch block and Where do you want to logg that error ? are you guys are creating text files for logging

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          R Offline
          R Offline
          Reelix
          wrote on last edited by
          #4

          web.config files SHOULD help... Hide's those nasty error pages, makes it so you can't add .cs onto files (Admin.aspx.cs ftl...), and ALOT more :) http://www.google.co.za/search?q=web.config

          S 1 Reply Last reply
          0
          • R Reelix

            web.config files SHOULD help... Hide's those nasty error pages, makes it so you can't add .cs onto files (Admin.aspx.cs ftl...), and ALOT more :) http://www.google.co.za/search?q=web.config

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            Might be replied to wrong person :)

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            R 1 Reply Last reply
            0
            • S Sandeep Akhare

              Might be replied to wrong person :)

              Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

              R Offline
              R Offline
              Reelix
              wrote on last edited by
              #6

              Well, a web.config file can stop runtime errors from displaying(And can possibly log them) :)

              1 Reply Last reply
              0
              • P pubududilena

                Hi, We have developed website using ASP.NET,C#. But they are runtime errors and we got yellow pages. So How do we catch Runtime errors and Log them? please advice.

                N Offline
                N Offline
                N a v a n e e t h
                wrote on last edited by
                #7

                pubududilena wrote:

                So How do we catch Runtime errors and Log them?

                When any uncaught exception occurs, ASP.NET fires Application_Error event. Global.asax is having the event handler defined, you can use that. Or write a custom HTTP module and hook application error event. For logging, I have used log4net[^] - it's a great product. Alternatively you can use web.config's custom error section. When any error occurs, it will be redirected to the specified page. But if the application is running in heavy traffic, this won't be a good approach.

                All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups