2 Replies Latest reply on Apr 17, 2008 12:47 AM by hitsum

    Logging from a custom action

    earniedyke

      Greetings all,

      I have a custom action (see below) from which I am trying to log debug info to the JBoss server.log. The only output I see however is from the System.out.println. Should I not be able to use log4j logging from within an action?

      Thanks in advance for any and all help!

      Earnie!

      package org.ebsinc.itbridge.action;
      
      import org.apache.log4j.Logger;
      import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
      import org.jboss.soa.esb.actions.ActionProcessingException;
      import org.jboss.soa.esb.helpers.ConfigTree;
      import org.jboss.soa.esb.message.Message;
      
      public class TestAction extends AbstractActionPipelineProcessor {
       private Logger log = Logger.getLogger(TestAction.class);
      
       protected ConfigTree config;
      
       public TestAction(ConfigTree config) {
       this.config = config;
       }
      
       public Message process(Message message) throws ActionProcessingException {
       System.out.println("TestAction is processing");
       log.debug("TestAction is processing");
       message.getBody().add("targetId", new Integer(8));
       log.debug("TestAction is complete");
       return message;
       }
      
      }
      


        • 1. Re: Logging from a custom action
          earniedyke

          Ever experience one of those brain farts where as soon as you hit the submit button, the answer to your question comes to you? Well I just had one. Helps if you check to make sure the threshold on your logger is DEBUG and not INFO.

          Sorry for waisting bandwidth!

          Earnie!

          • 2. Re: Logging from a custom action
            hitsum

            Hi earniedyke,

            Have you tried to send the log to a different log file other than server.log. What I am trying is to seprate the lloging of my custom actions to a different file.

            Thank you.

            Hitesh