You don't need a keylogger. Just take some things you've written and count the characters. It won't be exact since it excludes rewrites but the distribution should be very close.
You do need a keylogger, and a context-aware one at that for proper analysis, otherwise it's better to just use an existing layout, won't get much extra from personal corpus anyway, so not worth the effort to do a poor personalized analysis
Ignoring the obvious privacy issues, it provides great suggestions and learns some words that are not in the other keyboards' dictionaries.
Maybe you could apply the same for aiding an algorithm to create a personalized keyboard layout.