• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

.NET logging

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
derekl
Asked:
derekl
  • 2
  • 2
  • 2
  • +4
4 Solutions
 
Bob LearnedCommented:
Are you talking about the EventLog class for reading/writing from the system event logs or external files?

Bob
0
 
dereklAuthor Commented:
No, just logging arbitrary messages to a file.  Mainly for debugging purposes.
0
 
Bob LearnedCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
dereklAuthor Commented:
No, .NET console or windows forms applications.
0
 
s_sansanwalCommented:
Try

http://sourceforge.net/projects/nspring

Cheers,
S Sansanwal
0
 
armoghanCommented:
0
 
TheAvengerCommented:
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
 
AgariciCommented:
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
 
AgariciCommented:
sorry TheAvenger, i did not see your post
0
 
TheAvengerCommented:
NP, happens sometimes when two people are writing the answers simultaneously
0
 
vinhnlCommented:
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now