简体   繁体   English

NLog在文件顶部写入文件日志

[英]NLog write file log on top of file

How to write log as newest on the first in file? 如何在第一个文件中写入最新的日志? Is there some configuration? 有配置吗?

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# 这是一个向后读取文件的流: 如何在C#中使用迭代器反向读取文本文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM