Is it safe to post log files such as syslog, kernlog, xorg.o.log from /var/log
online to ask for help with an Ubuntu system?
Is there any private content in these files that other people should not see?
There can always be private/sensitive info in them. You should review any file before posting it online, including logfiles.
No. It is not safe to publish your system logs online. While the chance of exploiting the information obtained from them is slim, it is a best practice to anonymize them as best as you can.
Do not ever post logs online without cleaning them of personal data.
That mean that you should remove hostnames, usernames, and IP addresses.
It is your personal responsibility to scrub your logs of any personally identifiable data.
Now, how you might accomplish that is a separate question.