Solved

.NET logging

Posted on 2004-10-06
15
216 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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!
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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