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 » log4j issue

Post new topic  Reply to topic
 log4j issue « View previous topic :: View next topic » 
Author Message
WMBSAM
PostPosted: Mon Oct 19, 2009 10:31 am    Post subject: log4j issue Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

hello i am trying to use the support pac provided for the logging in log4j format .

the issue is i am trying to use the api's(functionalities as described in the manual in the ESQL but some how it doesn't work.

Here is my ESQL code:

Code:

CREATE FUNCTION initLog4j( IN CONFIG_FILE_NAME CHARACTER )
        RETURNS BOOLEAN
        LANGUAGE JAVA
        EXTERNAL NAME "com.ibm.broker.IAM3.Log4jNode.initLog4j";

        CREATE FUNCTION log4j( IN COMPONENT_NAME CHARACTER,
        IN LEVEL CHARACTER,IN TEXT CHARACTER )
        RETURNS BOOLEAN
        LANGUAGE JAVA
        EXTERNAL NAME "com.ibm.broker.IAM3.Log4jNode.log";
       
CREATE COMPUTE MODULE MyApplicationFlow_log4j
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
       CALL CopyEntireMessage();
      
      DECLARE rc BOOLEAN;
        CALL initLog4j('C:\Documents and Settings\wmbsam\My Documents\iam3\samples\brokerlog.xml') INTO rc;
        IF ( rc = FALSE ) THEN
           
           PROPAGATE TO TERMINAL 'out1';           
        -- error initializing log4j My Message is $ESQL:InputRoot.XMLNS.Test
       
        END IF;

       
        CALL log4j('MyApplicationFlow.msgflow', 'WARN','My Message is $ESQL:InputRoot.XMLNS.Test$') INTO rc;
        IF ( rc = FALSE ) THEN
        -- error during logging
        PROPAGATE TO TERMINAL 'out';
        END IF;
      
      RETURN TRUE;
   END;

   
   CREATE PROCEDURE CopyEntireMessage() BEGIN
      SET OutputRoot = InputRoot;
   END;
END MODULE;


In debug mode i can clearly see that the functions initLog4j,log4j returns true(boolean type)

I get the following Output in Log file:

11:10:27,996 WARN [MyApplicationFlow.msgflow] My Message is $ESQL:InputRoot.XMLNS.Test$

Any suggestions???
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 19, 2009 11:27 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Yes.

Both of those PROPAGATES will return back to the ESQL.
Back to top
View user's profile Send private message
WMBSAM
PostPosted: Mon Oct 19, 2009 11:45 am    Post subject: Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

I changed the code and removed the propagate statement but the result is the same.

Here is the change i made:
Code:
DECLARE rc BOOLEAN;
        CALL initLog4j('C:\Documents and Settings\wmbsam\My Documents\iam3\samples\brokerlog.xml') INTO rc;
       /* IF ( rc = FALSE ) THEN
           
           PROPAGATE TO TERMINAL 'out1';           
        -- error initializing log4j My Message is $ESQL:InputRoot.XMLNS.Test
       
        END IF;*/

       
        CALL log4j('MyApplicationFlow.msgflow', 'WARN','My Message is $ESQL:InputRoot.XMLNS.Test$') INTO rc;
        /*IF ( rc = FALSE ) THEN
        -- error during logging
        PROPAGATE TO TERMINAL 'out';
        END IF;*/


and here is the Output I get its the same result:
12:41:54,855 WARN [MyApplicationFlow.msgflow] My Message is $ESQL:InputRoot.XMLNS.Test$
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Oct 19, 2009 11:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What result are you expecting?
Back to top
View user's profile Send private message
WMBSAM
PostPosted: Mon Oct 19, 2009 12:44 pm    Post subject: Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

ftp://ftp.software.ibm.com/software/integration/support/supportpacs/individual/iam3.pdf

in the above user guide in example 6 it says for the
ESQL:
LogText = My Message is $ESQL:InputRoot.XMLNS.Test$

the output is:
Result:
11:55:14,010 WARN [default.Log4jXmlTestFlow] MyMessage is testPART

which doen't happen in my case

i trying to use it in esql compute node and it doesn't work.
Back to top
View user's profile Send private message
TonyD
PostPosted: Mon Oct 19, 2009 6:04 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

I think the $ESQL .... $ format is for use in the Log4j custom node, as opposed to calling Log4j from ESQL as you are doing.
Try:

CALL log4j('MyApplicationFlow.msgflow', 'WARN','My Message is ' || InputRoot.XMLNS.Test) INTO rc;
Back to top
View user's profile Send private message Send e-mail
WMBSAM
PostPosted: Tue Oct 20, 2009 11:06 am    Post subject: Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

Tony i tried what you have said but it doesn't work.

I have followed what exactly the manual says but it doesn't work.
Back to top
View user's profile Send private message
WMBSAM
PostPosted: Tue Oct 20, 2009 8:37 pm    Post subject: Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

The only success i got is by using the log4j node where the xpath variables work but when i try to use it by esql no matter what i use the xpath or the esql format nothing works.
Back to top
View user's profile Send private message
TonyD
PostPosted: Wed Oct 21, 2009 3:45 pm    Post subject: Reply with quote

Knight

Joined: 15 May 2001
Posts: 540
Location: New Zealand

WMBSAM wrote:
Tony i tried what you have said but it doesn't work.

I have followed what exactly the manual says but it doesn't work.


WMBSAM,
What result did you get? The Log4j node examples are not applicable when you call Log4j from your ESQL. I assume that 'Test' is the root element of your message. Specify:

InputRoot.XMLNS.Test.AnElementName

:in your Log4j call.
It does work! ... I have tested it.
Back to top
View user's profile Send private message Send e-mail
WMBSAM
PostPosted: Wed Oct 21, 2009 10:15 pm    Post subject: Reply with quote

Voyager

Joined: 02 Oct 2009
Posts: 90
Location: Atlanta

My bad acctually i had a attribute in the parent element

Thanks Tony for the valuable advice it really works!!!!
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 » log4j issue
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.