Solved

.NET logging

Posted on 2004-10-06
15
212 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

16 Experts available now in Live!

Get 1:1 Help Now