Does Android keep activity logs or save keystrokes? I want to know whether Android phones records activity logs of what I have done in a whole day. I've already checked that there is no Carrier IQ.

Is this true that after switching off the phone all activity logs vanish? Does my Android phone keep saving what keystrokes I typed? (I'm using Samsung keyboard.) Do all activity logs and keystrokes gets upload to my Google account server or any other account like Samsung?
No, stock Android doesn't record everything you do in a day. There are a few things to bear in mind, though.

First, because Android is open-source, the manufacturer, and your carrier if you bought the phone from a carrier, can change the OS however they like. They might have changed it to add a log like you describe, so though Android itself doesn't record all your activity, I can't say for certainty whether your phone does or not.

Second, there's nothing to stop individual apps keeping records. For example, Chrome keeps a record of what websites you visit, and if you have "Web history" turned on, it syncs that information with your Google account. Other apps might use analytics to track what you do inside that app, and send that information to the app's author. Apps have access to a lot of information, even some information not directly related to the app (such as what other apps you have installed), so you have to trust the app not to do this.

Keyboard apps are another example of this. They learn what words you have typed, and maybe collocations of words (for example, if you type "Cambridge" followed by "Circus", it might save this in order to better predict it in future). Whether this information is uploaded to any server depends on the particular keyboard app.

The log you might have heard about in Android isn't an "activity log" at all: it contains debugging information for developers to see what apps are going, and to help find and fix problems. It's not intended to log what you're doing, though sometimes the information in there could be used to identify particular actions, and what apps you're using. Exactly what information this log contains depends on the phone you have, and it differs from app to app.

As you've mentioned, the log is only in memory and so it's lost when the device reboots. It's also a fixed size (the exact size is different on different devices), so over the course of a day newer log entries will continually overwrite older entries.