JavaFx Logging Example
The simplest way is probably to use the java.util.logging framework and route its output to a file like this: How to get the Java Logger output to a default file . Then you don't need to worry about packaging any additional dependencies for the registration frameworks. If you do, you should be using the java.util.logging api, which is a little awkward compared to slf4j, but still works.
You could use slf4j as your frontend instead, but you would need to package additional jar files with your application to accomplish this.If you know maven then perhaps the easiest way would be to build libraries to build your project with zenjava maven plugin with appropriate dependencies placed in your project pom for slf4j log libraries you would like to use. (I haven't used the zenjava maven tool myself).
source to share