Log4J For Logging The Data in Java Palletes of BWS.: Steps
Log4J For Logging The Data in Java Palletes of BWS.: Steps
STEPS
1. For Each BW Interface, add an entry in the log4j.properties file as mentioned
below. (Path:: <tibco-home>\bw\5.2\lib\log4j.properties)
log4j.logger.TESTLogger=DEBUG, TEST
log4j.appender.TEST=org.apache.log4j.RollingFileAppender
log4j.appender.TEST.File=C:\\BPM \\TEST_Logger.log
log4j.appender.TEST.MaxFileSize=100MB
log4j.appender.TEST.MaxBackupIndex=5
log4j.appender.TEST.layout=org.apache.log4j.PatternLayout
log4j.appender.TEST.layout.ConversionPattern= %-5p %c - %m%n
2. In the Java Pallete, Instantiate the Logger Object first and then use the required
level of logging methods to log the data into the above mentioned log file.
LoggerName shall be the Global Variable containing the name of the logger
given in the properties file.For the above case it is TESTLogger
Instantiation:
org.apache.log4j.Logger logger =
org.apache.log4j.Logger.getLogger(LoggerName);
Logging Methods
logger.debug(xxx..)
logger.info(yyyy..)
logger.error(zzza..)
logger.warn(adfa..)
Note:
In Unix Server , do the first step before deploying the Engine in Admin.
The path in unix env for the
log4j.appender.TEST.File=$HOME/BPM_JAVA_LOGS/TEST_Logger.log