You can Google oracle rotate listener log and try one of the 100,000 plus hits on this topic.

Do you mean listener log or the alert log, since you mention both in your question? What do you mean by trim? Keep part of the original in the new version of the file? Or do you mean rotate?