Whether it's log4j doing it or anything else in any language whatever, appending text to the beginning of a file is an ugly process that goes like this:
1. Write the new text to a new file. 2. Copy all the old text from the old file, appending it to the new file. 3. Delete the old file. 4. Rename the new file.
Obviously that isn't something you would want a logging package doing on a regular basis. So I would suggest you review your requirements and find a different way to implement whatever requirement prompted that idea.