Taking the second requirement first, to provide integrity protection you need to either sign the log messages or generate an HMAC of the messages. That in turn requires that the app have access to either a private key for signing or a symmetric key for generating authentication codes.
That, in turn, means that you need to limit access to your app so that the key can't be extracted from it. This means that you've gone from trusting the access control on the log file to trusting the access control on your application. Compromised access to the application still allows third parties to modify your log file in a 'supported' fashion.
You can possibly, depending on the structure of your application and how it's deployed, use Mandatory Access Controls on the log file to make it append-only to users of the app, to mitigate the possibility of tampering or removing existing messages. You could additionally take periodic backups of the log file, and compare the content to ensure that nothing has been changed or removed between backups. This assumes that access to your backups is also controlled - a third party who can tamper with your backups can tamper with your log files in an undetectable fashion.
You didn't mention whether the application is on a server, desktop or smartphone, so the specifics of such access control aren't in scope for this answer.
As far as ensuring that a message has been successfully written before the app continues is concerned, Apache's log4j contains appenders that support this M.O. (just don't wrap them in AsyncAppender
…)