Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

.NET logging

Posted on 2004-10-06
15
Medium Priority
?
220 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 128 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 124 total points
ID: 12246145
0
 
LVL 20

Assisted Solution

by:TheAvenger
TheAvenger earned 124 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 124 total points
ID: 12271676
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

926 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