2 Replies Latest reply on Apr 7, 2011 2:48 AM by kc@dafolo.dk

    Custom Service Component to setup LOG4J logger

    kc@dafolo.dk Level 1

      Hi all,

       

      I am doing a project where I have a number of processes (renderPDF, renderPDFA, and renderPCL) Each of these processes are run many times during the day and they need to log in each of their own logfiles. I have setup the log4j properties file up right and got almost what I want. Now I just need all of the above processes to share the same log instance. Hence I have tried to create my own service component that should be instantiated at startup of the server. However I must do something wrong as I do not get anything logged in my log files.

       

      I have tried to add an executeScript step in the beginning of one of my processes (renderPDF) and after one invocation remove it. This seems to work, so my log4j stuff is working - however when I restart the server the log do not work anymore

       

      Please advice what to do or how to adress such an challenge

       

      Sincerely

      Kim Christensen

      Dafolo A/S

      Denmark

        • 1. Re: Custom Service Component to setup LOG4J logger
          $Nith$ Level 4

          Why don't you prefer Adobe's logging mechanism. If you use this, you could log everything on a central log file.

           

          import com.adobe.logging.AdobeLogger;

           

          private static final AdobeLogger logger = AdobeLogger.getAdobeLogger(YourClassName.class);

           

          logger.log(Level.INFO, 'Your Information to the central log file");

           

          Is this not what you want?

           

          Nith

          • 2. Re: Custom Service Component to setup LOG4J logger
            kc@dafolo.dk Level 1

            Hi again Nith,

             

            This was my initial thought as well, but the customer want the individual processes to log to individual files that rolls every day. Hence I am not sure I can use the AdobeLogger?

             

            The code you show here should be placed in a executeScript service right? And then it will log to the managed server log (I am on WebLogic 11g) i guess.

             

            Is my initial question/scenario impossible to achieve or is it just difficult?

             

            \Kim