Skip to content

Open log files in Log Viewer from Terminal or Finder

← Log Viewer
By Underrated SoftwareUpdated

The ordinary ways to open a log all work: double-click it in Finder, drag it onto Log Viewer, or choose File > Open… in the app. If the path is already in Terminal, use macOS’s open command. It asks LaunchServices to hand the file to Log Viewer, just as Finder would.

Open one log from Terminal

open -a "Log Viewer" /path/to/app.log

Quote Log Viewer because the app name contains a space, and quote any file path containing spaces too:

open -a "Log Viewer" "$HOME/Logs/Production API.log"

Open several logs

Put every log path after the application. Log Viewer receives each file through macOS’s normal open-file route and applies its usual tab and window behavior.

open -a "Log Viewer" ~/Logs/api.log ~/Logs/worker.log ~/Logs/access.log

Useful launch options

These are options for macOS’s open command, not log-viewer settings. They are useful in scripts and automations:

# Leave Log Viewer behind the current app
open -g -a "Log Viewer" /path/to/app.log

# Do not restore saved window state for this launch
open -F -a "Log Viewer" /path/to/app.log

# Wait until Log Viewer quits before continuing the script
open -W -a "Log Viewer" /path/to/app.log

Use -W only when the script really should wait for the entire app to quit, rather than merely for a file to finish opening.

Compare two logs side by side

The terminal command opens files but does not set Filter, Follow, or a tab-versus-window destination. To compare a particular log with the one already open, choose File > Open Beside… (Command-Shift-O) in Log Viewer and select it. The second file opens in an independent window beside the first when the screen has room, so you can filter one and follow or search the other without either view changing. The Window menu can merge tabs later or move a tab back into its own window.

Make it an Automator Quick Action

In Automator, create a Quick Action that receives files or folders in Finder. Add Run Shell Script, set Pass input to as arguments, and use:

open -a "Log Viewer" "$@"

You can then select one or more logs in Finder and run the Quick Action from the contextual menu.

Why use open instead of the app executable?

Log Viewer is distributed through the Mac App Store and is sandboxed. LaunchServices grants it access when it delivers a selected file through Finder or open. Running the executable inside the app bundle with a raw pathname does not provide the same file-access grant.

FAQ

Does this work while Log Viewer is already open?

Yes. open sends the selected file to the running app. If it is not running, macOS launches it and then opens the file.

Can I use this for logs in /tmp or another protected location?

Yes when your macOS account itself can read the file. Some system logs are readable only by root, and no app can bypass those Unix permissions.

Can Terminal start Log Viewer with Filter or Follow already enabled?

Not currently. The open command controls how macOS launches an app; it does not configure Log Viewer’s view state.

How do I compare two logs side by side?

Open the first log, then choose File > Open Beside… and select the second. This creates a separate window rather than another tab and places it beside the active one when there is room. Each window keeps its own search, filter and Follow state.

Try Log Viewer

See what Log Viewer does and check whether it fits your task.

FreemacOSDownload on the Mac App Store (opens in a new tab)