views:

28

answers:

1

We are currently using nLog for logging (which was an arbitrary choice made some months ago so it can be changed if necessary).

nLog can log to a database but requires a ConnectionString. This is an issue for us as we are in an n-tier environment and we have no database access at the Presentation tier (everything goes back to WCF hosted services in the mid-tier).

Does anyone have good recommendations for how I can get logs from a webfarm into a single consolidated repository (SQL, or it could be some other technology, e.g. MongoDb, etc.) that will sitting behind the mid-tier WCF?

Yes, I know that WCF and other issues can occur when trying to get to the logging repository (inaccessibity etc.) and in that case we will configure server based file logging or something to catch that.

I could use some wisdom here please.

Brian

A: 

For business logic related logging (ie not system errors), I would recommend creating a WCF endpoint and wrapping nlog in your business tier. So you would call your logging methods as you would any mid-tier method.

That leaves the system errors like db/network errors etc. For these the options include windows event log, email, file, twitter:) etc.. choose your pick. as long as it does not rely on database you are fine. And depending you how critical your app is, you may want to use a couple of methods like filesystem + email.

ravi