I would like to analyze a log file in emacs
while it is growing. Is it possible to have a buffer follow a file? It is not needed that the file be editable (which raises all sort of questions): read-only mode would suffice.
My problem in more detail is this:
revert-buffer
)I would like to improve this workflow by letting emacs
do the reloading automagically. Maybe a periodic revert-buffer
? How to setup such periodic reloading?
Use the auto-revert-tail-mode
to do this... I have following in my ~/.emacs
(just to convenience...):
(add-to-list 'auto-mode-alist '("\\.log\\'" . auto-revert-mode))
Have you tried using the auto-revert-tail-mode
? - Invoked with M-x auto-revert-tail-mode
Lee Hinman wrote an amazingly detailed and helpful writeup about working with log files in Emacs using auto-revert-tail-mode
at Writequit.org called, well, "Working with log files in Emacs".
You can also use the excellent itail tool from which can be installed from the MELPA repository. You invoke it as follows:-
`M-x` itail
You can use itail with local files as well as remote files using TRAMP. More information about itail can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With