Mysql has default built in function to logging transactions. In Mysql client, type above command. It will enabled logging in transaction. "output.log" file is created in Mysql bin directory.
Use the following command to run jar file for logging errors.
nohup java -jar -Xms1024m -Xmx2048m Test.jar &
Above command will run the "Test.jar" file in background and produce error file called "nohup" in same directory. ( All system out prints will be redirected into this file). So, developers can catch errors using the "nohup".