I really don't think there is a built in way to log to the platform from a Java SDK, but there are some workarounds I can think of.
The best one that comes to mind is the following:
If you go to [server-address]/Thingworx/logs and then click on one of the available logs you can see that they have ServiceDefinitions. The service you will find most valuable is this scenario is the Write service. By making a REST call from the Java SDK to the Write service for the log of your choosing, you can log a new message whenever you need to.
Hope that helps.