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. General Programming
  3. .NET (Core and Framework)
  4. Error logging for application

Error logging for application

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelpquestion
2 Posts 2 Posters 0 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.
  • R Offline
    R Offline
    ravibabu_kanaparthi
    wrote on last edited by
    #1

    Hi all, In my project we had system to log the exceptions through creating a text file for each day and writing the exceptions occured during tht day. The exceptions will be cathed through exception handling applied for necessary events. There is system class called using 'System.Diagnostics' in .net. Through which we can enter details in to a cutom log and we can see the details . My point is it better to use the application orinted logging as we are doing or Is it better to use the 'System.Diagnostics.EventLog()' for logging the errors. Is any one worked on these concepts..? Please let me know the details. Adavanced Thanks, yeggu

    R 1 Reply Last reply
    0
    • R ravibabu_kanaparthi

      Hi all, In my project we had system to log the exceptions through creating a text file for each day and writing the exceptions occured during tht day. The exceptions will be cathed through exception handling applied for necessary events. There is system class called using 'System.Diagnostics' in .net. Through which we can enter details in to a cutom log and we can see the details . My point is it better to use the application orinted logging as we are doing or Is it better to use the 'System.Diagnostics.EventLog()' for logging the errors. Is any one worked on these concepts..? Please let me know the details. Adavanced Thanks, yeggu

      R Offline
      R Offline
      rwestgraham
      wrote on last edited by
      #2

      Microsoft is pushing System Diagnostics logging, but I think you can argue for and against both methods. There are two clear cut cases: 1) Windows Services should definitely use "System" logs. 2) If you still have to support Win98, there are no system logs, so a conventional file method is your only option. Of course you could create multiple versions, but I see no compelling reason to do so just for logging. There are pluses and minus for both. For example, if you need to troubleshoot a weird problem it is a lot simpler to ask a client to find a folder and e-mail you a log file than it is to try to explain to them how to save a System log to a file and send it. On the other hand if you actually have access to the Event log viewer, you can assign levels when you write messages and then System logs make it easy to find critical errors out of possibly a large number of insignificent messages. Personally, I use both methods. If it is an application that I will be managing directly on a server I have access to I will use a System log. If it is a "3rd party app" that I don't expect to have direct access to once I've released it I ten d to still use the old fashioned flat file approach for the reason I've mentioned - I can always request an error log by e-mail if a problem arises. You really have to evaluate your own specific situation.

      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