Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Console.log in Java extension?

Greetings,

When "developing" javascripts within RTC, I find the console.log method to be very handy. What is the best "printf" method of debugging I can use from within an extension? I have a working Operation Advisor, but am now adding functionality to it and a piece is not working properly and I'd rather just use prints than debugging with Jetty at this point.

Thanks!

0 votes


Accepted answer

Permanent link
You can use below statements to get the Log instance which will log the statements you want in ccm,log.

import org.apache.commons.logging.Log;
import com.ibm.team.repository.common.LogFactory;
private static final Log fLog= LogFactory.getLog("<Logger.Name>");

You can use fLog.debug  to this instead of sysout.
You can control the log level from the log4j.properties in server\conf\ccm
log4j.logger.<Logger.Name>=debug
Dave Evans selected this answer as the correct answer

0 votes


One other answer

Permanent link
P.S. I can use the collector for now, but I was just wondering if there was an eaier method to use such as a message box or just writing to the error log.

0 votes

Comments

I use System.out.println and watch the server console (windows command prompt).

funny, I'd rather debug than watch the print output.

I'd rather debug than watch print out, too...but I've never developed anything in Java before and I didn't bother to get debugging working since it wasn't trivial. I am certain I will get to that point soon though! But I got my first extension (Operation Advisor) working nicely: An owner can't approve their own work items.

I just start my normal server in debug mode.  then connect from Eclipse to a Remote app.

debug both client and server at the same time.  only case where I can't do this is when I develop a jazz client side plugin, ten I need to start another eclipse locally in debug mode.

just add one line to the server.startup.bat as the last JAVA_OPTS line

set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3388

then the remote app port is 3388

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,950

Question asked: Dec 30 '13, 6:33 p.m.

Question was seen: 8,796 times

Last updated: Jan 02 '14, 12:25 p.m.

Confirmation Cancel Confirm