Solved

.NET logging

Posted on 2004-10-06
15
214 Views
Last Modified: 2010-04-15
I was hoping to get an idea of various logging packages available for .NET.

I've used (and like) log4j in Java and I know there is the .NET equivalent log4net.  What I was wondering is whether or not there are any logging packages built in to the .NET FCL, and if not, what other freewrae (no runtime restrictions) packages are available.
0
Comment
Question by:derekl
  • 2
  • 2
  • 2
  • +4
15 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12242259
Are you talking about the EventLog class for reading/writing from the system event logs or external files?

Bob
0
 

Author Comment

by:derekl
ID: 12242436
No, just logging arbitrary messages to a file.  Mainly for debugging purposes.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 32 total points
ID: 12242456
ASP.NET?  If so, then there is the System.Diagnostics.Trace class that you can use.  You can enable tracing in the config file for your web site.

Bob

0
 

Author Comment

by:derekl
ID: 12242626
No, .NET console or windows forms applications.
0
 
LVL 9

Expert Comment

by:s_sansanwal
ID: 12244814
Try

http://sourceforge.net/projects/nspring

Cheers,
S Sansanwal
0
 
LVL 18

Expert Comment

by:armoghan
ID: 12246129
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 31 total points
ID: 12246145
0
 
LVL 20

Assisted Solution

by:TheAvenger
TheAvenger earned 31 total points
ID: 12246315
Just use the Trace class as TheLearnedOne mentioned (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDiagnosticsTraceClassTopic.asp). It works for any kind of application, not only ASP.NET.

By default the logging is made in the output window of the VS IDE. However you can with one line add a listener, which writes to a file. Here is how: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticstextwritertracelistenerclasstopic.asp

There are other pre-given possibilities too, as well as a lot of possibilities to use your imagination. Read here about it: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticstracelistenerclasstopic.asp
0
 
LVL 11

Expert Comment

by:Agarici
ID: 12246323
you can use trace or debug classes to write messages. it you want to output this messages into a file, add a tracelistener that links to that file.

see this msdn link:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticstextwritertracelistenerclasstopic.asp


hth,
A.
0
 
LVL 11

Expert Comment

by:Agarici
ID: 12246333
sorry TheAvenger, i did not see your post
0
 
LVL 20

Expert Comment

by:TheAvenger
ID: 12246345
NP, happens sometimes when two people are writing the answers simultaneously
0
 
LVL 8

Assisted Solution

by:vinhnl
vinhnl earned 31 total points
ID: 12271676
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

910 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

20 Experts available now in Live!

Get 1:1 Help Now