views:

130

answers:

3

Hi,

I am designing a error logging feature so our servers (each donig different things) can have a central data store for logging errors.

Would it be a good idea to have the various applications writing to the error log file using a WCF service, or is that a bad idea?

they can do it just by ADO.NET to the database, which I think is the simpler route.

+1  A: 

I'd say just log to your local data store. The advantages are :

  1. Speed - it's pretty rapid to just dump your chosen error report to an existing data connection.
  2. Tracability - What happens if you have an error in your service? You lose all ability to chase down errors on all servers.
  3. Simplicity - If you change the endpoint for your errors service, you have to update every other application that uses the error service.
  4. Reporting - Do you really want to trawl through error reports from tens / hundreds of applications in one place when you could easily find them in the data store local to the app?

Of course, any of these points could be viewed from the other side, these are just my opinions.

ZombieSheep
there will be maybe 10-20 different apps/services I think, but yeah point taken.
+1  A: 

How about having a look at syslog? It was made for exactly that purpose.

kasperjj
A: 

We're looking at a similar approach, except for audit logging as well as error handling.

Looking at using WCF over netTcp, also looking at using the event log, but that seems to require high trust settings, and maybe performance issues.

Not convinced by ZombieSheep's objections:

  1. It's pretty rapid to dump your chosen error report over an existing WCF connection. Seriously. Plus, you can do it async/queued. Not a key factor for me.

  2. You log to the central service and the local service. When the erroer service comes back on line, you poll your machines for events since the last timestamp. Problem solved.

  3. Use a dns alias, and don't change the path - the way you should do internal addressing anyway IMO.

  4. What if you have multiple apps on a single machine? What if you want to see the timing of errors across multiple apps?