Solved

Logging Library

Posted on 2008-10-31
9
151 Views
Last Modified: 2013-11-07
Hi guys!

I need to write a logging module (dll) that handles logging for my executable projects any tips where to start.

I like to log exceptions and custom messages
0
Comment
Question by:AWestEng
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 150 total points
ID: 22852317
0
 
LVL 15

Assisted Solution

by:SRigney
SRigney earned 200 total points
ID: 22852436
The standard System.Diagnostics.Debug functionality is very robust as well.  You may not even need to include log4net.
0
 
LVL 16

Assisted Solution

by:Gyanendra Singh
Gyanendra Singh earned 150 total points
ID: 22855545
if you want to create your own logger refer this

http://www.codeproject.com/KB/vb/ErrorsAndEventsExample.aspx

else go fro Log4net as suggested by emoreau or use Logging and Instrumentation Application Block ( provided by microsoft)

http://www.codeproject.com/KB/architecture/GetStartedLoggingBlock.aspx

for log4net
http://www.codeproject.com/KB/aspnet/log4net.aspx
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:AWestEng
ID: 22858760
But I need it for a Vb.Net exe file, this seems to be to a web application ?
0
 
LVL 1

Author Comment

by:AWestEng
ID: 22858814
and there are now examples for windows .Net applications
0
 
LVL 1

Author Comment

by:AWestEng
ID: 22858959
thx guys for the examples.
log4net seems a  bit complex in my case, I must write my own one in this projects  so any other more "easier/smaller" examples?
 
0
 
LVL 15

Assisted Solution

by:SRigney
SRigney earned 200 total points
ID: 22859678
Using System.Diagnostics.Debug you can use the build in trace functionality.

http://msdn.microsoft.com/en-us/library/zd83saa2(VS.80).aspx


The trace listener can be hard coded or configured in a config file.
http://msdn.microsoft.com/en-us/library/system.diagnostics.tracelistener.aspx

If you are building your own class because you want to that's one thing.   But the built in version is the most simple with Log4net being only very slightly more complicated.   And both will be more simple than writing your own error handling around writing to files or whatever alternative output method you decide to use.
0
 
LVL 16

Assisted Solution

by:Gyanendra Singh
Gyanendra Singh earned 150 total points
ID: 22860326
refer this .. copy that class and use in your project and just pass the require information to that class thats it

http://www.codeproject.com/KB/vb/ErrorsAndEventsExample.aspx
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 150 total points
ID: 22861701
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
rebind a grid after user clicks on node in treeview 1 34
SQL Help 27 40
VB.Net - Get ColumnNames of SQL Table 4 10
VB.NET 2008 Publish Error 2 24
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now