Pages

Tuesday, December 6, 2011

A Generic Error Logging Object

 There are certain tasks that you find yourself doing over and over in multiple projects - and at some point it makes sense to just create a gizmo and re-use it.  Here is my logging object that can log messages (errors or just messages) to files and to a database.
Enjoy.

 If you want to log to a database, you must create the data table.



Next, add this object to your project (Project-Add New Item-C# Class)
Name the new object "log.cs"


Now, all you need to do to from your app is add a call to log. ...

Bryan Valencia is a contributing editor and founder of Visual Studio Journey.  He owns and operates Software Services, a web design and hosting company in Manteca, California.

No comments:

Share This!

Contact Us

Name

Email *

Message *