12

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?

8 Answers 8

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
5
  • i like this tool, very handy Sep 3, 2014 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 Sep 4, 2014 at 6:07
  • Franck, I'm sorry at offtop. What effect do you use on your first two screenshots? Thanks. Sep 5, 2016 at 16:49
  • @СашаЧерных I got the screenshots from the web Sep 5, 2016 at 16:50
  • 1
    @СашаЧерных FastStone Capture (faststone.org/FSCaptureDetail.htm) can do the blurring effects on screenshots.
    – Dimblefeck
    Mar 28, 2017 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.

0
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

3
  • 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? Sep 3, 2014 at 20:04
  • @javapowered sure, added to answer. Sep 3, 2014 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, 2014 at 4:03
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.

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.

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.

2
  • 1
    The question is tagged Windows. I don't think less would work there
    – Tymric
    Sep 3, 2014 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. Aug 27, 2015 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!

0

I wrote such a tool ("loxx") you can have a try at https://loxx.app/wp-content/uploads/loxx_setup.exe. It supports filtering, color highlighting, regex search, time stamps and much more also for running logs (used Baretail for a long long time but missed some features). enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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