12 Replies Latest reply on Jan 18, 2011 9:13 AM by Igor JStarter

    Riftsaw - log to specific file

    Igor JStarter Novice

      Hey!

       

      I need to log let's say a line for every BPEL invoke of a external WS. How to do that?

       

      I hoped I could somehow write the log text to a variable and print it to a file, everything in BPEL ?

       

       

      But now after readings ... I saw that some users did:

      bpel.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener

      debugeventlistener.dumpToStdOut=on

       

      And then wrote their CustomBpelEventListeners ....

       

      Could somebody explain if I can log to a file just in BPEL and if not

      what are the steps for turning on BPEL logging and catching the events ?

       

      Thanks in advance!

       

      Regards, Igor!

        • 1. Riftsaw - log to specific file
          Gary Brown Master

          Hi Igor

           

          I don't believe it is possible to do this from the BPEL process.

           

          Information on the event listener mechanism can be found in the quickstarts/bpel_event_listener/readme.txt.

           

          Regards

          Gary

          • 2. Riftsaw - log to specific file
            Igor JStarter Novice

            Thank you very much Gary!

             

            I almost thought <bpel:echo> is going to work .)

             

            That means...

            1.  riftsaw.sar/bpel.properties

            add line: bpel.event.listeners=org.jboss.riftsaw.event.RiftSawEventListener

            2.  copy org.jboss.riftsaw.event.RiftSawEventListener from the bpel_event_listener quickstart to your project..

            3.  restart server

             

            I don't see any new logs... defined by the RiftSawEventListener:

            package org.jboss.riftsaw.event;

            import org.apache.ode.bpel.iapi.BpelEventListener;

            import org.apache.ode.bpel.evt.BpelEvent;

            public class RiftSawEventListener implements BpelEventListener {

                public void startup(java.util.Properties properties) {System.out.println("MYLOG - RiftSaw BPEL event listener started");}

                public void onEvent(BpelEvent bpelEvent) {System.out.println("MYLOG -- RiftSaw BPEL event: "+bpelEvent);}

                public void shutdown() {System.out.println("MYLOG -- RiftSaw BPEL event listener stopped");}

            }

             

            And i don't see anything new when starting the server...  There must be something more to do ???

            Working on that... if someone has an idea, please post...

             

            What is more... How can i tell JBoss that he should print this event logs to a specific file and not into the server.log...

            • 3. Riftsaw - log to specific file
              Gary Brown Master

              Have you added the:

               

                  <process name="bpl:HelloWorld">

                      <active>true</active>

                      <process-events generate="all"/>

               

                      <provide partnerLink="helloPartnerLink">

                          <service name="intf:HelloService" port="HelloPort"/>

                      </provide>

                  </process>

               

              'process-events' element in your deploy.xml?

               

              You would need to create and log to the file within your own implementation of the listener interface.

              • 4. Riftsaw - log to specific file
                Igor JStarter Novice

                I have it added in the my deploy.xml. It looks like:

                  <process name="alertUsers:alertUsers">

                    <active>true</active>

                    <retired>false</retired>

                    <process-events generate="all"/>

                    <provide partnerLink="client">

                      <service name="alertUsers:alertUsers" port="alertUsersPort"/>

                    </provide>

                    <invoke partnerLink="TransactionLink">

                      <service name="axis2:TransactionsService" port="TransactionsServiceHttpSoap11Endpoint"/>

                    </invoke>

                    <invoke partnerLink="PerftechLink">

                      <service name="kkiss.adapters.ws.mmw.perf.si:WsKKISSAdapterService" port="WsKKISSAdapterPort"/>

                    </invoke>

                  </process>

                 

                So I don't see anything here I could change...  The <retired> can't be so important ....

                Any other idea ?   btw There is no bpelContent in the event listener quickstart example...

                 

                About the log file: I understand what you mean.  I'll do that...

                But that has nothing to do with the log4j possibility?  I thought we'll be using log4j logger....

                • 5. Riftsaw - log to specific file
                  Igor JStarter Novice

                  I lied...  now I see a warning in the log:

                  WARN  [org.jboss.soa.bpel.runtime.engine.ode.BPELEngineImpl] (main) Couldn't register the event listener org.jboss.riftsaw.event.RiftSawEventListener, the class couldn't be loaded properly: java.lang.ClassNotFoundException: org.jboss.riftsaw.event.RiftSawEventListener from BaseClassLoader@1920c51{VFSClassLoaderPolicy@1669fc6{name=vfsfile:/home/jboss-5.1.0.GA/server/default/deploy/riftsaw.sar/ domain=ClassLoaderDomain@6f8b2b{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@fa3ac1} roots=[MemoryContextHandler@8622411[path= context=vfsmemory://3j001-vlw09q-gj2qv9c7-1-gj2qwrg8-1l real=vfsmemory://3j001-vlw09q-gj2qv9c7-1-gj2qwrg8-1l], FileHandler@28835923[path=riftsaw.sar context=file:/home/jboss-5.1.0.GA/server/default/deploy/ real=file:/home/jboss-5.1.0.GA/server/default/deploy/riftsaw.sar/], DelegatingHandler@18701437[path=riftsaw.sar/lib/riftsaw-bpel-epr-2.1.1.Final.jar context=file:/home/jboss-5.1.0.GA/server/default/deploy/ real=file:/home/jboss-5.1.0.GA/server/default/deploy/riftsaw.sar/lib/riftsaw-bpel-epr-2.1.1.Final.jar], DelegatingHandler@10698028[path=riftsaw.sar/lib/riftsaw-bpel-schemas-2.1.1.Final.jar context=file:/home/jboss-5.1.0.GA/server/default/deploy/ real=file:/home/jboss-5.1.0.GA/server/default/deploy/riftsaw.sar/lib/riftsaw-bpel-schemas-2.1.1.Final.jar], DelegatingHandler@17115801[path=riftsaw.sar/lib/riftsaw-scheduler-simple-2.1.1.Final.jar context=file:/home/jboss-5.1.0.GA/server/default/deploy/ real=file:/home/jboss-5.1.0.GA/server/default/deploy/riftsaw.sar/lib/riftsaw-scheduler-simple-2.1.1.Final.jar], DelegatingHandler@3124105[path=riftsaw.sar/l

                  • 6. Riftsaw - log to specific file
                    Gary Brown Master

                    Did you run the 'ant deploy' from within the bpel_event_listener quickstart? This places a jar in the riftsaw.sar/lib folder.

                     

                    You could create log4j enties and then filter them out as required.

                    • 7. Riftsaw - log to specific file
                      Igor JStarter Novice

                      In my opinion it is the same file structure as in the bpel_event_listener example...

                       

                      So, in my myprojectname/

                      -settings

                      -bpelContent  (with .bpel, .wsdl, deploy.xml)

                      -src (which I copied from the bpel_event_listener ... with folder structure org.jboss.riftsaw.event.RiftSawEventListener)

                      -build.properties

                      -build.xml

                       

                      Where should I copy the src folder ?

                      • 8. Riftsaw - log to specific file
                        Gary Brown Master

                        Does your build.xml construct a jar with the compiled event listener and place it in the riftsaw.sar/lib?

                        • 9. Riftsaw - log to specific file
                          Igor JStarter Novice

                          Thank you Gary!  It's WORKING!

                           

                          I really should have seen it in the build.xml, that he's doing some extra work and not just deploy...

                                  <path id="compile-classpath">

                                  <fileset dir="${org.jboss.as.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->

                                  <fileset dir="${riftsaw.lib.dir}" includes="*.jar" /> <!-- Required for JMS Client Code. -->

                           

                          So, I needed to run ant deploy on the bpel_event_listener quickstart example once...  now it's "logging" events...

                           

                          But, on one BPEL WS call i cached about 40 events... Now I have to study how to use them for some smart logs .)

                           

                           

                          So this is working!  

                          But I would really like to know how I could use log4j. Could you tell something more about creating the entities ... ?

                          • 10. Riftsaw - log to specific file
                            Igor JStarter Novice

                            Yes, the line <jar basedir="${build.dir}" destfile="${riftsaw.lib.dir}/${sample.jar.name}" /> generates the file Quickstart_bpel_event_listener.jar.

                            • 11. Riftsaw - log to specific file
                              Gary Brown Master

                              Sorry, you'll have to find the info elsewhere - but the log4j configuration is performed in $jbossas/server/default/conf/jboss-log4j.xml for the server, but you might be able to override that locally within your own module.

                              • 12. Riftsaw - log to specific file
                                Igor JStarter Novice

                                Thank you very much!  You helped me a lot ...

                                 

                                If anybody could tell something more about using log4j, please post ...

                                 

                                Regards, Igor!