c# - Error logging in Windows Application -


I have a Windows application and I want to log errors using Log4Net.

I have to face to log these errors Where If I'm logging in to a local folder, logs will be on the client machine, which is easily available to us Are not there.

Therefore, we thought of 2 options:

  1. Log error on a shared (network) location
  2. Log error in DB
  3. < / Ol>

    The issue in logging errors in DB is that if there is a problem, after connecting to the DB, the logging fails clearly, so we decided to log in to a common location.

    Now, someone told me that it is not a good practice to log in to the shared space.

    What can you do to ensure logging when it is possible that you can log in everywhere perhaps accessible or down?

What shared place?

Generally you are always at risk of not being logged, because the client machine can lose network connectivity. In this situation, logging in to the shared space, database, web service, and whatever is not helping you from the remote.

It is possible that at least a friction professional solution would be to use a service like it is not the only one, there are other similar services

if you do not forget it, in a database Logging is usually quite enough in practice if you can enter not database due to one of the following:

  • Connectivity problem
  • A bug in the logging code

Again, in practice, the probability of the latter, (either Sheen lost a network connection or DB server or it is offline)

  • Enough test is small enough, since the logging codes are not all complicated, the former is more likely, so you have to manage this scenario separately . Typically locally logged (local file / event log) is a good idea if the database logging failed. It is difficult to obtain this data from customer data, but in rare cases you have to solve the connectivity problem, which is a life-saving protector.

    Logging on "shared space" as "window sharing" is not common and in my opinion there is no benefit when entering a database, both the database and the shared space may be down the client There can be no connection in the computer In all these circumstances both options behave the same.

    In some scenarios, when network connectivity is restored, it is wise to upload the logfile locally to the database saved, but it is often overkill.


  • Comments

    Popular posts from this blog

    Member with no value in F# -

    java - Joda Time Interval Not returning what I expect -

    c# - Showing a SelectedItem's Property -