Comment 2 for bug 1419112

Revision history for this message
Matt Brown (mattbrown-2) wrote :

DCS has 2 scenarios for startup that have a direct affect on which log4j appender is used when logging events.

 First, When DCS is started using bin/dcs-start.sh script the following properties are set:
-Ddcs.log.dir=/opt/home/matbrown/git/dcs-1.1.0/bin/../logs
-Ddcs.log.file=dcs.log
-Ddcs.home.dir=/opt/home/matbrown/git/dcs-1.1.0/bin/..
-Ddcs.id.str=
-Ddcs.root.logger=INFO,console
-Ddcs.user.program.home=/opt/home/matbrown/git/core/sqf
-Ddcs.conf.dir=myconf
-Ddcs.trafodion.home=/opt/home/matbrown/git/core/sqf

And, using bin/dcs it's possible to run any DCS class just by specifying the fully qualified class name. When this happens the following properties are set:
-Ddcs.log.dir=/opt/home/matbrown/git/core/sqf/sql/local_hadoop/dcs-1.0.0/bin/../logs
-Ddcs.log.file=dcs-matbrown-1-server-g4t3016.houston.hp.com.log
-Ddcs.home.dir=/opt/home/matbrown/git/core/sqf/sql/local_hadoop/dcs-1.0.0/bin/..
-Ddcs.id.str=matbrown-1
-Ddcs.root.logger=INFO,DRFA
-Ddcs.user.program.home=/opt/home/matbrown/git/core/sqf
-Ddcs.conf.dir=/opt/home/matbrown/git/core/sqf/sql/local_hadoop/dcs-1.0.0/bin/../conf
-Ddcs.trafodion.home=/opt/home/matbrown/git/core/sqf

From a log4j.properties perspective the important properties are:
dcs.log.dir
dcs.log.file
dcs.root.logger

In the first scenario above the "console" appender is used and this typically sends events to System.err.
In the second scenario the "DRFA" appender is used and events are sent to a daily rolling file.

The problem comes in when JdbcT2 driver is used. The HBaseClient.java class overwrites the "DRFA" appender directing all output to conf/ trafodion.hdfs.log file. Since no regard is given to existing appenders in this class all DCS events are "lost" to the trafodion log file.