11

I have text file, like log.txt which constantly updates. I want some text editor which I can open on separate monitor to display this file. I want this text editor to "reload" text file from disk periodically (every N seconds) and to scroll down. What can you recommend?

9

If you prefer a GUI, you can use BareTail:

  • free and paid versions available
  • Windows
  • Portable
  • Like "tail -f" on Unix systems, but with many more features

enter image description here

  • Tail multiple files

enter image description here

  • Configurable highlighting

enter image description here

enter image description here

enter image description here

  • Optimised real-time viewing engine
  • View files of any size (> 2GB)
  • Scroll to any point in the whole file instantly
  • View files over a network
  • Configurable line wrapping
  • Configurable TAB expansion
  • Configurable font, including spacing and offset to maximise use of screen space
| improve this answer | |
  • i like this tool, very handy – Oleg Vazhnev Sep 3 '14 at 20:09
  • i tried all suggestions but this tool is the best, it's very fast and works fine even when log file grows fast – Oleg Vazhnev Sep 4 '14 at 6:07
  • Franck, I'm sorry at offtop. What effect do you use on your first two screenshots? Thanks. – Саша Черных Sep 5 '16 at 16:49
  • @СашаЧерных I got the screenshots from the web – Franck Dernoncourt Sep 5 '16 at 16:50
  • 1
    @СашаЧерных FastStone Capture (faststone.org/FSCaptureDetail.htm) can do the blurring effects on screenshots. – Dimblefeck Mar 28 '17 at 13:55
5

If you just want to watch the log as it grows, look at the 'tail' utility in a command line window.

There's a port of some of the most common unix utilities to Windows at http://unxutils.sourceforge.net/ That package has the advantage that it requires nothing in the way of support - just drop the files somewhere in your path and they just work.

To use tail to watch a log file, open up a command line window (cmd.exe) and do:

tail -f <log.txt>

It'll just keep scrolling out the contents as the log file grows. Ctrl-C to stop.

| improve this answer | |
4

You can use Windows PowerShell (free, included in Windows XP and later):

Get-Content test.txt -Wait

enter image description here

To change width:

enter image description here

enter image description here


Useful info left by ADTC as a comment: you should also change the Defaults if you want the width to be saved and restored on a new PowerShell instance, see screenshot below.

enter image description here

| improve this answer | |
  • i like it because it doesn't require additional software. default window width is 80, can I add some argument to change window width to 120 or 150? – Oleg Vazhnev Sep 3 '14 at 20:04
  • @javapowered sure, added to answer. – Franck Dernoncourt Sep 3 '14 at 21:38
  • 1
    You may want to mention that you should also change the Defaults if you want the width to be saved and restored on a new PowerShell instance. You can use this screenshot link. – ADTC Sep 4 '14 at 4:03
  • 1
    @ADTC Thanks, added in answer! – Franck Dernoncourt Sep 4 '14 at 21:49
3

If you have Git (or GitHub) installed, you can find the tail utility available in Git Shell*. You can use it to follow any file:

tail -f logfile.log

Those experienced with Unix and Linux terminals will find this very familiar. Try tail --help for more information.

* Usually this is a modified instance of Windows PowerShell.

You can also find the less utility installed with Git. As per the help text:

                         MOVING
F                    Forward forever; like "tail -f".

Note: I don't recommend installing Git just for this. But if you already have Git installed, there's no need to find third party tail or less utilities.

| improve this answer | |
1

Log Expert is an open source alternative that is quite feature-rich. It has a so called tail mode to view the end of the file.

Some standard features:

  • colorization of rows based on regex patterns
  • search

Some original features:

  • columnizers - split a log row into fields and interpret fields as date, time, or various other data types (you can write your own custom columnizer).
  • time sync - you can sync two files, and jumping to a certain time in one of them will sync the other to the same (or close) time

This Youtube video contains a screencast of the tool.

| improve this answer | |
0

Or you can use less, a free and open-source tool written and maintained by Mark Nudelman.

less +F log.txt

The advantage of less is that you can toggle it between being a file viewer (this disables automatic scrolling, and lets you search and scroll manually) and a log follower. Ctrl+C takes you into "less" mode (file viewer mode). And Shift+F returns you to follow mode.

| improve this answer | |
  • 1
    The question is tagged Windows. I don't think less would work there – Tymric Sep 3 '14 at 19:01
  • @Timmy: There are ways to install less on Windows. If the asker needs help doing so, he can post a comment here and ask for advice. – unforgettableidSupportsMonica Aug 27 '15 at 18:22
0

During development I use Emacs text editor to monitor logs.

emacs-w32 from Cygwin is easier way to get Emacs and necessary environment.

Tail update to certain kinds of files can be added via:

(defun my/auto-revert-tail-mode-hook ()
  "Enable `auto-revert-tail-mode' for file in 'log' dir or ending on '.log'"
  (when (string-match "/logs?/\\|\\.\\(?:log\\|out\\)\\'"
                      (buffer-file-name (current-buffer)))
    (auto-revert-tail-mode 1)
    ))
(add-hook 'find-file-hook 'my/auto-revert-tail-mode-hook)

With TRAMP and ssh installed I can see updates in remote log files!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.