Is it safe to post syslog kernlog xorg.o.log from /var/log online to solve a problem with ubuntu system? There is private content in there 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.