While there are many posts about this (here and here, for example), and of course the general answer is always "it depends"... in this case it seems fairly clear-cut to me that you should simply hide the "Log out" option.
One reason to keep an option visible even when not available is to allow people to learn the options and where they live in your UI. For a very common option like Log Out, the user will probably not need to learn that once logged in they will have an option to log out. I expect there will be SOME change to the state of the page that will help visually indicate that they are logged in, so they will expect to be able to log out. Placing a log-out option in a menu (particularly in space-constrained settings like mobile) is probably not going to surprise anyone, so I don't think findability will be a concern.
Also it may depend on whether or not there is a convention for disabling menu items across your system. If so, then showing it as disabled might be better... but I suspect that is not the case.
Obviously the best thing to do is test some options with actual users - I have very little context on your situation so I'm speaking in generalities. But hiding the control seems like a safe default to start with. I might suggest that if the Log Out appears in the menu, make sure it always appears at the bottom or at the top so other menu items don't shift around too much; it might also be wise to make it visually distinct from other menu options since it is a fairly drastic option.
I'd expect that your system will log the user out automatically after a specific time interval, which may provide another consideration for testing. In my experience some people NEVER log out of an app, they just rely on that auto-logout function and navigate away from the app; possibly something to test that might give you a little more insight.
Good luck!
P.S. Bear in mind that there is generally a third option to this question around buttons: you can hide them, disable them, or "leave the control active and message the user if they interact with it outside of full compliance." This latter option can be good for forms, particularly long ones, but it does not seem relevant here, and it probably does not apply to menu items in general.