11

When I run brew services list one of my services state shows err. brew services restart elasticsearch@6 for example stops and restarts with no error output and shows:

brew services restart elasticsearch@6
Stopping `elasticsearch@6`... (might take a while)
==> Successfully stopped `elasticsearch@6` (label: homebrew.mxcl.elasticsearch@6)
==> Successfully started `elasticsearch@6` (label: homebrew.mxcl.elasticsearch@6)

But list still shows err. There's something wrong but Homebrew doesn't tell us what it is. How to fix this problem?

1 Answer 1

9

Look at the log file in /usr/local/var/log/elasticsearch.log.

TL;DR

If you look at the formula definition with:

brew edit elasticsearch@6

You will find the content of the plist file used for this service, which define the output log as:

#{var}/log/elasticsearch.log

According to the documentation:

#var ⇒ Object

The directory where the formula's variable files should be installed. This directory is not inside the HOMEBREW_CELLAR so it persists across upgrades.

According to the source code:

def var
  HOMEBREW_PREFIX/"var"
end

You can find the HOMEBREW_PREFIX with:

brew --prefix

It is most likely /usr/local. So you will find your log file in /usr/local/var/log/elasticsearch.log.

1
  • 1
    Thanks all the errors seem related to Java, I'm MacOS Big Sur so I may see what's going on there Commented Feb 25, 2021 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .