Re: C# log component

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Sat, 15 Sep 2007 11:12:00 +0200, George <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hello everyone,


I am using C# and Visual Studio 2005 to develop a class library. I am
wondering whether there are any built-in log component in C# so that I can
utilize directly other than write from scratch?

I am also wondering if there does exist such log component, if multiple
processes using the built-in log component to open the same log file to write
log (in my application, I want all processes which loads the class library
DLL to have a common log file), will there be any risk of racing condition
(e.g. interlacing log of one process and another process)? Do we need any
lock/synchronization approach?


thanks in advance,
George


Hi George,

In addition to Marc's suggestion there is also log4net

http://logging.apache.org/log4net/index.html

I haven't tried logging to file, but it seems robust enough that numerous logging sources should not be a problem.

--
Happy coding!
Morten Wennevik [C# MVP]
.



Relevant Pages

  • Re: C# log component
    ... I am also wondering if there does exist such log component, ... processes using the built-in log component to open the same log file to write ... DLL to have a common log file), will there be any risk of racing condition ... I haven't tried logging to file, but it seems robust enough that numerous logging sources should not be a problem. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# log component
    ... i wrote my own..logging....multi threaded service ... I am also wondering if there does exist such log component, ... processes using the built-in log component to open the same log file to ... DLL to have a common log file), will there be any risk of racing condition ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# log component
    ... I am also wondering if there does exist such log component, ... processes using the built-in log component to open the same log file to write ... You can automatically configure trace switches and listeners from your ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# log component
    ... wondering whether there are any built-in log component in C# so that I can utilize directly other than write from scratch? ... I am also wondering if there does exist such log component, if multiple processes using the built-in log component to open the same log file to write log, will there be any risk of racing condition? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# log component
    ... if that fails ... I am also wondering if there does exist such log component, ... processes using the built-in log component to open the same log file to ... DLL to have a common log file), will there be any risk of racing ...
    (microsoft.public.dotnet.languages.csharp)