4

How to write log as newest on the first in file? Is there some configuration?

Simon
  • 3,235
  • 5
  • 36
  • 47
  • 2
    It is an expensive operation - to write on the top of the file. I would amaze if it exists in any logger. – zerkms Jan 21 '11 at 11:29

1 Answers1

3

You will not find any logger which can do that since the whole file have to be rewritten each time a new log entry is added.

Find a log viewer which can view the log in reverse order instead. Is a lot more resource efficient.

Update

Here is a stream which reads a file backwards: How to read a text file reversely with iterator in C#

Community
  • 1
  • 1
jgauffin
  • 99,844
  • 45
  • 235
  • 372