Best way to log an application

S

Salvatore Di Fazio

Hi,
I would like to know which is the best way to make a log file in a
C# .Net application.

Somebody talks good about log4net.
But is there something in the framework to use?

Bye
 
S

Salvatore Di Fazio

Usehttp://msdn2.microsoft.com/en-us/library/system.diagnostics.trace.aspx.
You can configure how tracing happens be it file, xml file, delimited file,
console or event log by configuring trace listeners in code or using the
app.config file. It's easy to turn on and off, you can even set the trace
level.

Oh Thanks.
I just reading the msdn.
I tried few minutes ago.
I dind't see a column with the execution time and the information
about the function where the Trace was called.
Maybe I need to check better through the example or maybe you must
format the string.
 
N

not_a_commie

Somebody talks good about log4net.
But is there something in the framework to use?

I don't think you can do better than log4net. The latest version works
really well (once you figure out how to use the additivity keyword).
It's nice to be able to log to a screen console (built out of a
textbox) and a file simultaneously and have different log levels on
each.
 
M

Michael Nemtsev

Hello Salvatore,

Alternative solution, apart described there, is to use Logging Application
Blocks
See there http://msdn2.microsoft.com/en-us/library/aa480464.aspx

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

SF> Hi,
SF> I would like to know which is the best way to make a log file in a
SF> C# .Net application.
SF> Somebody talks good about log4net.
SF> But is there something in the framework to use?
SF> Bye
SF>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top