What do you mean when you say “it will not work” ? No output in the server.log (the same when you call debugLog) ?
When you call the System.out.println in java, it prints the string to the standard output. It’s independent of the file the debugLog uses.
So if you want to retrieve the string, redirect the output when you launch your server.{sh|bat}
[....]/server.sh >> whatyouwant.log
#webMethods#Flow-and-Java-services#Integration-Server-and-ESB