It's all about the answers!

Ask a question

How to setup log4j


Han Jie (10120) | asked Dec 28 '07, 2:53 a.m.
Where I try CQ connector.

D:\RTC_beta2\JazzCQConnector-0.6Beta2 \jazz\connectors\gateway>synctool.bat -Dcq.query.Defect="Public Queries/All_Defect"

Running SyncTool...
log4j:WARN No appenders could be found for logger (com.ibm.rational.interop.detail).
log4j:WARN Please initialize the log4j system properly.
Trying to login to http://139.25.106.34:9080/jazz ...
Successfully logged in.

I really need more log information, but how to setup log4j.

6 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Dec 28 '07, 9:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
See message: https://jazz.net/forums/viewtopic.php?t=537

Cheers,
Geoff


hanjie_siemens wrote:
Where I try CQ connector.

D:\RTC_beta2\JazzCQConnector-0.6Beta2
\jazz\connectors\gateway>synctool.bat
-Dcq.query.Defect="Public Queries/All_Defect"

Running SyncTool...
log4j:WARN No appenders could be found for logger
(com.ibm.rational.interop.detail).
log4j:WARN Please initialize the log4j system properly.
Trying to login to http://139.25.106.34:9080/jazz ...
Successfully logged in.

I really need more log information, but how to setup log4j.

permanent link
Han Jie (10120) | answered Dec 28 '07, 10:39 p.m.
Yeah. before I sent my original post
I have done the setting up according to link U mentioned.

I also tried to start my command in

D:\RTC_beta2\JazzCQConnector-0.6Beta2\jazz\connectors\gateway>synctool.bat -Dcq.query.Defect="Public Queries/All_Defect
-Dlog4j.configuration=file://"D:\RTC_beta2\JazzCQConnector-0.6Beta2\jazz\connectors\gateway\log4j.properties"

But system error is
log4j:ERROR Ignoring configuration file .

permanent link
Han Jie (10120) | answered Dec 29 '07, 12:19 a.m.
Here is the content of file log4j.properties under <cq_connector>/gateway

log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %-50.50c - %m%n
log4j.logger.com.ibm.rational.interop=DEBUG
log4j.logger.com.ibm.rational.interop.detail=DEBUG

permanent link
Geoffrey Clemm (30.1k33035) | answered Dec 29 '07, 9:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The example you tried below will not work because log4j does not
understand URI syntax for its configuration file (i.e. the "file://..."
syntax).

Let's first get logging working for your gateway (server.startup.bat),
and then we can work on logging for the importer (synctool.bat).

To keep things simple, let's assume you will cd to the gateway
directory, and then invoke server.startup.bat ... i.e.:
cd ...\jazz\connectors\gateway
server.startup.bat
and not:
...\jazz\connectors\gateway\server.startup.bat

Then you can just define the log4j.properties file as:
-Dlog4j.configuration=log4j.properties

So your ...\jazz\connectors\gatewayserver.startup.bat file should look like:

set JRE_HOME="%cd%"\win32\ibm-java2-i386-50\jre
set CATALINA_HOME="%cd%"\tomcat
set
CATALINA_OPTS=-Dcom.ibm.rational.interop.gateway.configURL="file:///"%cd%"/cqconnector.properties"

-Dlog4j.configuration=log4j.properties
set JAVA_OPTS=-Xmx700M
%CATALINA_HOME%\bin\startup.bat

and your ...\jazz\connectors\gateway\log4j.properties file should look like:

log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p
%-50.50c - %m%n
log4j.logger.com.ibm.team.interop.service.outgoingSyncJob=DEBUG
log4j.logger.com.ibm.team.interop=DEBUG
log4j.logger.com.ibm.rational.interop=DEBUG
log4j.logger.com.ibm.rational.interop.detail=OFF

Cheers,
Geoff


hanjie_siemens wrote:
Yeah. before I sent my original post
I have done the setting up according to link U mentioned.

I also tried to start my command in

D:\RTC_beta2\JazzCQConnector-0.6Beta2\jazz\connectors\gateway>synctool.bat
-Dcq.query.Defect="Public Queries/All_Defect
-Dlog4j.configuration=file://"D:\RTC_beta2\JazzCQConnector-0.6Beta2\jazz\connectors\gateway\log4j.properties"

But system error is
log4j:ERROR Ignoring configuration file
.

permanent link
Han Jie (10120) | answered Jan 01 '08, 9:18 p.m.
Ok. I setup my environment with your instruction.
And then Where I should find the log informaiton.
(sorry, I am a freshman of log4j)

permanent link
Geoffrey Clemm (30.1k33035) | answered Jan 02 '08, 12:48 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The log messages will appear on whatever is considered to be the
"standard output" for the application generating the log information.
With the CQ Gateway on Windows, that would be the command window that
gets created when you run the gateway server.startup.bat script.

Cheers,
Geoff

hanjie_siemens wrote:
Ok. I setup my environment with your instruction.
And then Where I should find the log informaiton.
(sorry, I am a freshman of log4j)

Your answer


Register or 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.