1 Reply Latest reply on Oct 26, 2002 4:35 PM by icanoop

    How do I log?

    icanoop

      All I want to do is be able or log or print info from inside my EJB.

      Please someone tell me how to do this.

      I know to use log4j, I know that jboss already has it. I import org.apache.log4j.Logger and then create one with getLogger(). I have no idea what the argument for getLogger should be for jboss or if it even matters.

      I do that stuff and then do log.error("test error message"). But nothing seems to be printed on the jboss console or logged anywhere. I even did a grep -r on my whole jboss directory and found nothing.

      My EJB deploys with no errors or anything, but no log message appears. Can someone please provide a simple, basic, step by step instruction on how I can just log a string from in my EJB?

      Sorry for the pathetic question, but I am really stuck on this one.

      Ryan

        • 1. Re: How do I log?
          icanoop

          Nevermind. I finally figured it out. The problem had nothing to do with log4j at all. It works just fine. The problem was that my implementation of toString is apparently not being called, but instead the default one is. I was logging the info in the toString method and it was never being called so of course my messages were never being logged.

          Now I'm one step closer to being a good jboss programmer. Man, I miss Linux C programming where I actually know alot.

          Ryan