Understanding Logistic Regression Cost function
The way my intuition works for logistic regression is simple, say you are trying to classify if you have a picture with a dog on it, if that is the case, you output 1 (true), if not, you output 0 (false)

The cost function essentially represents the diff between what your model output (imagine, you have a dog in a picture, and your model outputs 0.75 instead of 1, your cost is 0.25). 

Now, this is not a very mathematical way to put it, but at least it has helped me a lot to understand logistic regression.