1 2 Previous Next 22 Replies Latest reply: Jan 17, 2010 11:21 PM by 741012 Go to original post RSS
      • 15. Re: log4j statements are comming in managed.out...
        741012
        Hi Sandeep,

        I did the following :

        LFXMLSocketAppender la = new LFXMLSocketAppender();
        la.setApplication("_mmukul");
        la.setLocationInfo(true);
        la.setRemoteHost("localhost");
        la.setPort(55200);
        la.setReconnectionDelay(5000);
        Logger serverLogger = Log4jLoggingHelper.getLog4jServerLogger();
        serverLogger.addAppender(la);

        and it was able to listen to logfaces port 55200 , but still not able to log anything into the datacase or send out email reports.

        I saw in log4j.xml there is a <root> section which has a reference to Logfaces appender

        <appender name="LFS" class="com.moonlit.logfaces.appenders.LFXMLSocketAppender">
        <param name="Application" value="mukul"/>
        <param name="LocationInfo" value="true"/>
        <param name="RemoteHost" value="localhost"/>
        <param name="Port" value="55200"/>
        <param name="reconnectionDelay" value="5000" />
        </appender>

        <root>
        <priority value="debug"/>
        <appender-ref ref="LFS"/>
        </root>

        Since its still not working the expected way logfaces should work i guess we need to have that root added to the startup class as well? How can we achieve that?
        I tried using the getRootLogger().addAppender() method but didnt work out.

        Thanks,

        Mukul.
        • 16. Re: log4j statements are comming in managed.out...
          745372
          Hi there,
          logFaces is a commercial product, why won't you [post a support request|http://www.moonlit-software.com/logfaces/web/contact/index.php] and we will try our best to help you out.
          Please give me more details on what you are trying to achieve and I will get you going in no time.

          Kind regards,
          Dmitry,
          www.logfaces.com
          • 17. Re: log4j statements are comming in managed.out...
            741012
            Hi Dmitry,

            Thanks for this. We already have a licensed version of logfaces with us and its working helping us a lot in logging and reporting application level logs. But the issue we are facing is with the server level lost we have our application deployed on weblogic 10.3 and in case of errors like jvm out of memmory we have no way to detect this since logfaces is not configured to work with server level logs.


            The problem is weblogic does not expose it log4j.xml or log4j.properties file so to add appenders to the weblogic run time appenders i had to write a custom code as you would see in this thread. Now even after doing this i am not able to log server level details into the database neither any email goes out since there is no report generated.

            Any Help will be highly appreciated as sometimes our production server die without any alert and we would like to have a sol in place asap.

            Thanks,

            Mukul.
            • 18. Re: log4j statements are comming in managed.out...
              651958
              So when you add the logfaces appender to the log4j.xml do you get the application log messages in your database? Can you call Log4jLoggingHelper.getServerLogger().getAppenders() and iterate over the list to ensure that the logfaces appender is present?

              Also can you try calling setThreshold(Level.DEBUG) if the LogFacesAppender extends from AppenderSkeleton?

              Thanks

              Edited by: sandeepks on Jan 11, 2010 11:34 AM
              • 19. Re: log4j statements are comming in managed.out...
                741012
                Hi Sandeep,

                The below lines will add the logfaces appender to weblogic runtime and will log admin server level log messages to the DB and report them as well.
                     try{
                     LFXMLSocketAppender la = new LFXMLSocketAppender();
                     la.setApplication("xyz");
                     la.setLocationInfo(true);
                     la.setRemoteHost("locahost");
                     la.setPort(55200);
                     la.setReconnectionDelay(5000);
                     la.activateOptions();
                     Logger serverLogger = Log4jLoggingHelper.getLog4jServerLogger();
                     serverLogger.addAppender(la);
                     log.debug("Added Logfaces Appender");
                     }catch(Exception ex) {
                     log.debug("failed while Adding Logfaces Appender");
                     System.err.println("failed while Appending Logfaces " + ex.getMessage());
                     ex.printStackTrace();
                     }

                Thanks,

                Mukul
                • 20. Re: log4j statements are comming in managed.out...
                  741012
                  Hi Sandeep,

                  We ran into some issue while deploying logfaces. We actually had to use it for out of memory conditions on weblogic 8.1 server logs but the problem is..weblogic 8.1 has no option in admin console for changing default jdk loggingmplementation to log4j ..i suppose they added this feature from weblogic 9.0 onwards?

                  Thanks,

                  Mukul
                  • 21. Re: log4j statements are comming in managed.out...
                    651958
                    Yes you are right. The option to choose between JDK and Log4j APIs for Server Logging was introduced with WebLogic Server version 9.0

                    Sandeep
                    • 22. Re: log4j statements are comming in managed.out...
                      741012
                      Hi Sandeep,

                      But since we want a common solution for both 8.1 and 10.3 clients , I suppose there is one more solution of JMX Custom MBeans to read the weblogic log files and sending email to the users.
                      Any idea on this?

                      Thanks,

                      Mukul.
                      1 2 Previous Next