Where should I keep error logs?

I am building a C # / Asp.Net web application (FW 2.0) and I was wondering where I should keep the error log entry.

I could write it in a file on the server, but to me this seems implausible. This would be incompatible with the idea of ​​a database.

Another gentle answer in the database, but what happened if I have no connection with the database. If the client receives a database connection error, what should I do (because the server and the database are not on the same machine, obviously)?

Your suggestions are welcome.

What are you

Edit: I'm talking about basic bug reporting here, please don’t address things like large frameworks like log4net.

+3
source share
8 answers

Having a backup mechanism is a very correct scenario. Logging into the Windows event log is often impractical because log analysis is not easy, as in relational databases. But allowing events to be recorded in the event log when a database crashes is not a luxurious IMO option.

This scenario is one of the reasons why I created the registration framework (I will not refer to it as you requested). It supports the concept of "fallbackProvider", which allows you to register an event on an alternative log in the event of a failure of the main registrar. When you write your own journal mechanism, you can accept this concept.

Good luck.

+2
source

DB log4net nlog " ". , , , .

+3

; , ! , , , , .

, Enterprise Library. , / , .

, ,

+1

, :

  • , - , SQLlite SQLServer Compact.
  • (xml ), .
  • . (, ).
0

log xml , asp.net perms eventviewer, -, .

0

, Gibraltar. , -, . , , .

I see that you are a student, Frank. Email me directly to discuss the possibility of providing us with a free license.

0
source

-System Event Viewer
- you can cache your error in the local and light db file (maybe SqLite / Sql Compact), and then, when the connection is available, you send it to the server

-1
source

Source: https://habr.com/ru/post/1731202/


All Articles