Closed rmos5 closed 11 months ago
Unfortunately the way files work on current operating systems makes this extremely slow to do (the entire contents of the log file need to be effectively re-written on every insert). There's an earlier discussion somewhere in the Serilog.Sinks.File repository about this, but I haven't been able to track it down so can't link it here, sorry. Thanks for dropping by, though!
Closest I could find is https://github.com/serilog/serilog-sinks-file/issues/301 There may be a canonical issue somewhere on stackoverflow, but the bottom line is that this is infeasible
You're right, it's user point of view and is a responsibility of a log presentation software.
Another one (again adding little): https://stackoverflow.com/questions/73650710/serilog-how-to-log-messages-in-ascending-order-in-text-file
Inserting log record is much better for reading than appending. You can see latest records immediately instead of scrolling to end and read from bottom to head.
Parameter in constructor would be fine. Thank you.
Cheers, rmos.