How to write a registrar

So, I would like to write a registrar in C # for the application I'm working on. However, since I love performance, I do not want to open and close the log file again and again at run time.

I think that I would like to write all events to RAM, and then write to the log file once when the application exits. Would this be good practice? If so, how do I implement it?

If this is not good practice, what would be?

(And I do not use the Windows event log at this time.)

+3
source share
3 answers

However, since I love efficiency, I don’t want to open and close the log file again and again at run time

No. This is since you love premature optimization.

I think that I would like to write all events to RAM, and then write to the log file once when the application exits. Would this be good practice? If so, how do I implement it?

, ?

, ?

, , ( , ). ?

+6

, :

  • ( ?), .
  • , , .

( FileShare.Read, ), , .

+3

, , . , .. Lazy write:

(.. -). logger . , .

( -) ( ), - .

Rgds,

0
source

All Articles