Thanks Sean the last option -Dhbase.root.logger=DEBUG,DRFA does the trick.
2014-11-14 14:58 GMT-08:00 Sean Busbey <[email protected]>: > You needn't specify the log4j configuration file, the one in > hbase-server/src/test/resources will get put in the test classpath for you. > > The default appender in that file is on stderr, which surefire will swallow > somewhere in the temp directory it creates for running things. > > Usually when I need log output from tests, I activate the daily rolling > file appender from the command line. ex: > > mvn > -Dtest=TestTableSnapshotInputFormat#testInitTableSnapshotMapperJobConfig > -Dhbase.root.logger=DEBUG,DRFA package > > this will place the log output in hbase-server/hbase.log > > > > On Fri, Nov 14, 2014 at 3:15 PM, Stephen Boesch <[email protected]> wrote: > > > I still have not been able to locate the testing logs output. There are > no > > new directories/files created under the hbase distro directory at the > time > > the test is run, or under hbase-server. The hbase book does not mention > > this either. http://hbase.apache.org/0.94/book/hbase.tests.html > > > > The command line is the same as mentioned earlier: > > > > mvn -Dmaven.surefire.debug="-Xdebug > > -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -Xnoagent > > -Djava.compiler=NONE" test > > -Dtest=TestTableSnapshotInputFormat#testInitTableSnapshotMapperJobConfig > > > > > -Dlog4j.configuration=file:$HBASE_HOME/hbase-server/src/test/resources/log4j.properties > > > > 2014-11-13 17:18 GMT-08:00 Stephen Boesch <[email protected]>: > > > > > Hi Ted, > > > as mentioned in that SOF post (a) breakpoints are not respected when > > > launched inside IJ (but they ARE respected when launching mvn command > > line) > > > and (b) logging is not working in both IJ and command line > > > > > > 2014-11-13 17:13 GMT-08:00 Ted Yu <[email protected]>: > > > > > > TestTableSnapshotInputFormat is a unit test which you can run from your > > IDE > > >> directly. > > >> > > >> BTW there was a typo in the command line below w.r.t. the test name. > > >> > > >> Cheers > > >> > > >> On Thu, Nov 13, 2014 at 4:57 PM, Stephen Boesch <[email protected]> > > >> wrote: > > >> > > >> > How can logging be enabled/viewed when launching the hbase tests via > > >> > command line maven? > > >> > > > >> > Given the following mvn command, I am able to set breakpoints within > > an > > >> IDE > > >> > (intellij): > > >> > > > >> > mvn -Dmaven.surefire.debug="-Xdebug > > >> > -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 > > -Xnoagent > > >> > -Djava.compiler=NONE" test > > >> > > -Dtest=TestTleSnapshotInputFormat#testInitTableSnapshotMapperJobConfig > > >> > > > >> > > > >> > However, there is no stdout/stderr or log4j output anywhere. > > >> > > > >> > The only output is the following (Note there an exception deep > inside > > a > > >> > create table test but the details are not displayed!) > > >> > > > >> > Listening for transport dt_socket at address: 5005 > > >> > Running org.apache.hadoop.hbase.mapred.TestTableSnapshotInputFormat > > >> > 2014-11-13 16:40:27.560 java[47177:2496198] Unable to load realm > info > > >> from > > >> > SCDynamicStore > > >> > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: > > 178.141 > > >> sec > > >> > <<< FAILURE! > > >> > > > >> > Note: the hbase-server/src/test/resources/log4j.properties has > > settings > > >> > that are friendly to printing plenty of logging messages. But why > are > > >> the > > >> > messages not generated? > > >> > > > >> > # Define some default values that can be overridden by system > > properties > > >> > hbase.root.logger=INFO,console > > >> > hbase.log.dir=. > > >> > hbase.log.file=hbase.log > > >> > .. > > >> > # Logging Threshold > > >> > log4j.threshhold=ALL > > >> > .. > > >> > log4j.logger.org.apache.hadoop.hbase=DEBUG > > >> > > > >> > > > >> > BTW I also have a related post also on StackOverflow - this one > > focuses > > >> > more on starting/debugging a test within the Intellij IDE: > > >> > > > >> > > > >> > > > >> > > > http://stackoverflow.com/questions/26920330/logging-and-debugging-using-maven-within-intellij > > >> > > > >> > > > > > > > > > > > > -- > Sean >
