Sending Messages to The ActiveMatrix BusinessWorkss log4j File
The standard log4j logging service is available for components of ActiveMatrix BusinessWorks. For more information about using the ActiveMatrix BusinessWorks log4j properties file, see TIBCO ActiveMatrix BusinessWorks™ Process Design.
Code in the Java Code or Java Method activities can send messages to the log4j file by using the bw.logger
class. For example, the following code obtains the bw.logger
class and uses the class to send a message to the log file.
org.apache.logging.log4j.Logger logger = org.apache.logging.log4j.LogManager.getLogger("bw.logger"); logger.warn("This is a warning message from the either a Java Code or Java Method activity");
If you use your own logger class, you can configure the ActiveMatrix BusinessWorks log4j properties file to include your logger. This involves adding log4j.logger
and log4j.appender
properties to the properties file. For more information about log4j properties, see the log4j documentation . Once the properties for your custom logger class are added to the ActiveMatrix BusinessWorks log4j file, you can obtain your logger class and write messages to the log file in your Java Code and Java Method activities.