ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » using Log4j

Post new topic  Reply to topic
 using Log4j « View previous topic :: View next topic » 
Author Message
vijayakumar
PostPosted: Sat May 14, 2011 12:28 pm    Post subject: using Log4j Reply with quote

Centurion

Joined: 01 Aug 2010
Posts: 101

Please help me on how to use Log4j in message flows
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon May 16, 2011 4:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

The best way (IMNTBHO) is to use log4j, just as you would in any other Starbucks program (er.. Java program).

Put log4j jar in $MQSI_WORKPATH/shared-classes and log4j.properties in $MQSI_WORKPATH/common/wsrr .

Use Java Compute Node to output log info.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
j.f.sorge
PostPosted: Mon May 16, 2011 7:13 am    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

lancelotlinc wrote:
Use Java Compute Node to output log info.

You may use a static Java methods within your ESQL code, too.
_________________
IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
davecrighton
PostPosted: Sun May 22, 2011 6:20 am    Post subject: Reply with quote

Novice

Joined: 13 Jun 2007
Posts: 12

lancelotlinc wrote:
The best way (IMNTBHO) is to use log4j, just as you would in any other Starbucks program (er.. Java program).

Put log4j jar in $MQSI_WORKPATH/shared-classes and log4j.properties in $MQSI_WORKPATH/common/wsrr .

Use Java Compute Node to output log info.


Why the /wsrr directory? I'd put it in a jar inside shared classes personally, or possibly deploy it with the flow.
Back to top
View user's profile Send private message
vijayakumar
PostPosted: Sun May 22, 2011 10:20 am    Post subject: Reply with quote

Centurion

Joined: 01 Aug 2010
Posts: 101

J.f.sorge,

Can u explain how to use the java methods in esql for log4j?
Back to top
View user's profile Send private message
davecrighton
PostPosted: Sun May 22, 2011 12:36 pm    Post subject: Reply with quote

Novice

Joined: 13 Jun 2007
Posts: 12

The documentation is here:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ak04970_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac06009_.htm#ac06009___ac06009Java_

You can only call static methods since you have no way of constructing an object on which to run instance methods.

Since the log() methods on Logger aren't static you will need to write a Java class that exposes a static method that essentially does Logger.getLogger(String packageName).info(String logText);

Obviously you can expand that to include different log levels etc as you need.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » using Log4j
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.