Logging in Java driver
In the Java driver, all text sent to the standard out and error streams are
copied into the engine log file for the process that started this driver instance.
Logging performed with System.out.println()
calls go
to the system engine log file.
You can use more sophisticated logging mechanisms such as java.util.logging
or log4j
. This results in those messages going to the system engine log,
if those logging mechanisms are writing to standard out or standard error streams.
Commonly, these logging systems invoke these streams "logging to the console." This is true if you had started the JVM from a console.
Java util
logging is the standard utility for
logging information in Java, and is used extensively in the Java driver samples.
JVMs have a built in logging.properties file
which defines the default behavior of logging in different applications. These
defaults are useful in many cases. For debugging, it is helpful to have a more
detailed level of logging that you can turn down in production. In this case, it is
convenient to define a logging.properties file
specific to your system thread to log.
The Bounce sample thread does exactly this. In the .ini file it has this entry to make the JVM use a specified logging.properties file instead of its default:
define=java.util.logging.config.file=$SITEPATH/Bounce/logging.properties
This logging.properties file contains lines similar to this:
java.util.logging.ConsoleHandler.level = FINE
com.infor.level = FINE
These lines configure the console handler, which writes to the error
stream, and logger levels to log at the FINE level. These use the logger.fine()
calls in the Bounce thread’s code to make
it to the system logs.
For more information on Java util
logging, see the official
Java 6 documentation at this address. This contains a discussion of loggers, levels,
handlers, and others, involved in the use of Java util
logging:
http://docs.oracle.com/javase/6/docs/technotes/guides/logging/overview.html