JdbcT2 client log4j events incorrectly written to trafodion.hdfs.log

Bug #1419112 reported by Matt Brown
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
Fix Released
High
Matt Brown

Bug Description

See attached file for description of the bug

Revision history for this message
Matt Brown (mattbrown-2) wrote :
Changed in trafodion:
assignee: nobody → Matt Brown (mattbrown-2)
importance: Undecided → High
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.

Revision history for this message
Trafodion-Gerrit (neo-devtools) wrote : Fix proposed to core (master)

Fix proposed to branch: master
Review: https://review.trafodion.org/1148

Changed in trafodion:
status: New → In Progress
Revision history for this message
Trafodion-Gerrit (neo-devtools) wrote : Fix merged to core (master)

Reviewed: https://review.trafodion.org/1148
Committed: https://github.com/trafodion/core/commit/daf701a264c79d35a889e9bac7d5efa583b081dd
Submitter: Trafodion Jenkins
Branch: master

commit daf701a264c79d35a889e9bac7d5efa583b081dd
Author: matbrown <email address hidden>
Date: Tue Feb 17 18:57:01 2015 +0000

    HBaseClient.java may use external log4j.properties file

    The executor/HbaseClient.java class unconditionally configures
    log4j using conf/log4j.hdfs.config file. This caused a problem
    for external clients in that their log4j configurations were reset
    causing all subsequent client events to be written to the
    HBaseClient log file. A client may want its log events written
    to its own log file or console. This commit introduces a new property
    "hbaseclient.log4j.properties" so clients can specify which log4j
    properties file to use when HBaseClient sets up logging. For internal
    clients such as sqlci the existing behavior is maintained.

    Change-Id: Ic60b5d7f0e03a308f057ee6a9a9feaa47c4aaf1c
    Closes-Bug: #1419112

Changed in trafodion:
status: In Progress → Fix Committed
Revision history for this message
Trafodion-Gerrit (neo-devtools) wrote : Fix proposed to dcs (master)

Fix proposed to branch: master
Review: https://review.trafodion.org/1153

Revision history for this message
Trafodion-Gerrit (neo-devtools) wrote : Fix merged to dcs (master)

Reviewed: https://review.trafodion.org/1153
Committed: https://github.com/trafodion/dcs/commit/2c628d2ed5fa05119776469333fb68d223821e6f
Submitter: Trafodion Jenkins
Branch: master

commit 2c628d2ed5fa05119776469333fb68d223821e6f
Author: matbrown <email address hidden>
Date: Wed Feb 18 18:24:38 2015 +0000

    Logging for JdbcT2 driver now directed to DCS log

    A companion commit to bug/1419112. DCS log4j.properties now used
    when calling Trafodion HBaseClient.

    See bug 1419112

    Change-Id: Ic160d7307f938e12150bbf9c30f2272bd604f415

Matt Brown (mattbrown-2)
Changed in trafodion:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.