3
Log4j for logging the Data in Java Palletes of BWs. 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.RollingFileAp pender 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.Patter nLayout 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:

Using Log4j

Embed Size (px)

DESCRIPTION

USING_LOG4J

Citation preview

Log4j for logging the Data through Java Palletes of BWs

Log4j for logging the Data in Java Palletes of BWs.

STEPS 1. For Each BW Interface, add an entry in the log4j.properties file as mentioned below. (Path:: \bw\5.2\lib\log4j.properties)log4j.logger.TESTLogger=DEBUG, TESTlog4j.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 TESTLoggerInstantiation:

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