I have created a custom logback appender. But play gives a ClassNotFound exception for the appender.
Following is my appender
package log
import ch.qos.
Although the solution of adding a separate jar file works, I found another solution which adds the benefit of accessing your uri as defined in your application.conf file.
Create an EagerSingleton in your Module. This will get called during startup. Inside this, construct your MongoDB Appender and add it to the logger you want to log to MongoDB. The benefit is that you can inject your Configuration into this singleton and then access config settings to pass on to your MongoDB Appender.
It seems that play's dynamically compiled classes in dev mode are not available for logback. I'm struggling with the same issue. Putting my custom appender to a separate jar file works for me. I assume in prod with staged final jar files this should not be a problem.