Reloading of log4j configuration on WLS 6.1

I am wondering: Is there a way to reload the log4j properties/configuration
at runtime in WLS 6.1, something like the Struts' reload possibility?
Spending 15 minutes stopping and starting the server just for editing one
line of text isn't very cool...
Christer

Hi Christer,
I think it's better to ask this question in the log4j mailing list.
Meanwhile you may want to think about changing your
development pattern. Try changing 100 lines of code
instead of one and than running tests...
Regards,
Slava Imeshev
"Christer Brinchmann" <[email protected]> wrote in message
news:[email protected]..
I am wondering: Is there a way to reload the log4jproperties/configuration
at runtime in WLS 6.1, something like the Struts' reload possibility?
Spending 15 minutes stopping and starting the server just for editing one
line of text isn't very cool...
Christer

Similar Messages

  • Log4j configuration problem

    Can anyone explain why every line in the log file is printed twice - this is my log4j configuration file.
    thanks...
    Liat
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <!-- ===================================================================== -->
    <!--                                                                       -->
    <!--  Log4j Configuration                                                  -->
    <!--                                                                       -->
    <!-- ===================================================================== -->
    <!-- $Id: log4j.xml,v 1.1 2003/10/29 11:00:45 avir Exp $ -->
    <!--
       | For more configuration infromation and examples see the Jakarta Log4j
       | owebsite: http://jakarta.apache.org/log4j
    -->
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
             <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
            <param name="File" value="./BitbandClient.log"/>
            <param name="Append" value="true"/>
            <!-- Rollover at midnight each day -->
            <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            <!-- Rollover at the top of each hour
            <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
            -->
            <layout class="org.apache.log4j.PatternLayout">
                <!-- The default pattern: Date Priority [Category] Message\n -->
                <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
    <!--                            %-4r [%t] %-5p %c %x - %m%n-->
                <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
                <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
                 -->
            </layout>
        </appender>
        <!-- ============================== -->
        <!-- Append messages to the console -->
        <!-- ============================== -->
        <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
                <param name="Target" value="System.out"/>
                <param name="Threshold" value="INFO"/>
                <layout class="org.apache.log4j.PatternLayout">
                    <!-- The default pattern: Date Priority [Category] Message\n -->
                    <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
                </layout>
        </appender>
         <appender name="BITBAND-CONSOLE" class="org.apache.log4j.ConsoleAppender">
             <param name="Target" value="System.out"/>
             <param name="Threshold" value="DEBUG"/>
             <layout class="org.apache.log4j.PatternLayout">
              <!-- The default pattern: Date Priority [Category] Message\n -->
              <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c] - %m%n "/>
             </layout>
        </appender>
        <category name="com.bitband.maestro">
            <priority value="DEBUG"/>
            <appender-ref ref="BITBAND-CONSOLE"/>
            <appender-ref ref="FILE"/>
        </category>
        <!-- ======================= -->
        <!-- Setup the Root category -->
        <!-- ======================= -->
         <root>
             <priority value="INFO"/>
             <appender-ref ref="CONSOLE"/>
             <appender-ref ref="FILE"/>
        </root>
    </log4j:configuration>

    You're just begging for a [url http://en.wikipedia.org/wiki/RTFM]four-letter response :-)
    http://logging.apache.org/log4j/docs/manual.html
    The addAppender method adds an appender to a given logger. Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy. In other words, appenders are inherited additively from the logger hierarchy. For example, if a console appender is added to the root logger, then all enabled logging requests will at least print on the console. If in addition a file appender is added to a logger, say C, then enabled logging requests for C and C's children will print on a file and on the console. It is possible to override this default behavior so that appender accumulation is no longer additive by setting the additivity flag to false.

  • Log4j.configuration

    Hello,
    I am trying to bring out the log4j logs generated by enterprise application that I deployed. The log4j logs that I want to display are different from the system logs. The Servers -> Admin Server-> Logging defines a log file. This is system log. The application logs are the ones generated by the application I have deployed. I have a log4j.properties that contains the logfile name, location and other details. I would not prefer to drop the log4j.properties inside the weblogic directory because it is not a good practice.
    I shall list down the attempts I had made. But, all of them did not yield results.
    I tried to use from this link http://ananthkannan.blogspot.in/2009/09/how-to-configure-log4j-in-weblogic.html . That was not useful because I can't copy the log4j.properties inside weblogic directory and am not permitted to confuse the application & system logs.
    I tried to add parameters in the Servers -> Admin Server-> SeverStart -> Arguments
    -DSTP_CONFIG_PATH=C:/TEMP/install_websphere11565/STPConfig/STPSpringConfig.xml -Dlog4j.configuration=C:/TEMP/install_websphere11565/STPConfig/log4j.properties
    Both the above attempts did not generate the log file.
    May I request you where to tell weblogic to please use the log4j.configuration and what else to do.
    Thanks,
    Raj

    Hi people,
    I have got it working.
    Servers -> Your Server-> SeverStart -> Arguments
    -Dlog4j.configuration=file:C:/TEMP/install_websphere11565/STPConfig/log4j.properties
    What made the difference was I had to prefix 'file' for the log4j.properties location. I don't know its significance because springConfig is located without 'file', but it worked.
    Regards,
    Raj

  • Retrieve Log4j Configuration

    I am using apache log4j. It is working fine as per my log4j configuration file.
    Recently log4j configuration getting changed dynamically by some other application. So my application is not logging as per my configuration.
    I want to dynamically retrieve the log4j configuration.
    Is it possible to do it programmatically.
    Thanks,
    Govind

    Do you have to retrieve this configuration or do you simply want to override it?
    Anyway, depending on your application type, have a look at DOMConfigurator and BasicConfigurator
    Another tangent is to go the JMX route. Log4j exposes some MBeans that you can query and manipulate.

  • Could not read Log4j configuration file when I run jar file

    Hi,
    I'm using Log4J in my application..
    I configure the log4j, as follows;
    PropertyConfigurator.configure("properties/logging.properties");and then go on to use it.
    The .properties is in the root when I jar my source. I use Ant to Jar the file. It all works good when I run the jar file from ant.
    The problem is when I run the jar file by double clicking on it, I get an error
    " Could not read configuration file [properties/logging.properties]."
    I tried the following options;
    PropertyConfigurator.configure("/logging.properties");
    PropertyConfigurator.configure("./logging.properties");
    PropertyConfigurator.configure("../logging.properties");But in all cases, I get corresponding errors on running the jar file through Ant:
    log4j:ERROR Could not read configuration file [logging.properties].
    log4j:ERROR Could not read configuration file [./logging.properties].
    log4j:ERROR Could not read configuration file [../logging.properties].
    I want to be able to run the Jar by double clicking on it or through Ant.. Would any one know how to fix this issue so that I can use both methods..

    Keep your properties file inside the root folder of your application.It is working fine

  • JMS Queue configuration on WLS

    Dear Experts,
    I have a "Forward Delay" configuration for queues on WLS. I need to change it. What other configuration do I choose? What are the advantages and disadvantages of the configuration you are suggesting compared to "Forward Delay" ? And sorry for the last question can I find the documentation on web ?
    Thanks,
    Mike
    Edited by: Mike.Di on 13-ott-2010 6.54

    Hello Mike,
    what I should looking for in logs?You may find text like "Managed server mngd_server_name has been suspended or shutdown" or "Removing mngd_server_name+id from cluster view due to timeout" or "Adding <mngd_server_name> with ID <ID> to cluster: <cluster_name> view". If you see these log occurences frequently in the servers logs in spite of particular managed server being up and running, then it may be an issue. Oracle Support may analyze your environment and settings in a better way and hence they may provide better support for your issue.
    http://download.oracle.com/docs/cd/E14571_01/web.1111/e13738/best_practice.htm#CACJCGHG
    Pete,
    if you have a single OSB proxy service, and you specifiy the JNDI name of the distributed queue and not the specific member destination, you will get consumers on a single member of the distributed destination only.Perhaps you and me have different experience. I have worked with OSB versions 10.3, 10.3.1 and 11.1.1.3.0 but I never saw such issue. Even we read messages from distrbuted destinations lying on same JVM as well as on different JVM but each time I had consumers on all physical queues.
    Yes, suppose if one server goes down in the cluster then all the consumers of the physical queue which is deployed on that server, will get pinned to other physical queues and even after sometime if that server comse up again, no consumers will automatically get attached to the new member. For newly added member to have consumers on it, either client application has to be redeployed or server restart is necessary.
    In another scenario, where client application gets deployed first and then the weblogic servers are started, definitely all the consumers will get attached to one physical queue.
    Most important part is connection factory configuration. Server Affinity should remain disabled and load balancing should be enabled for proper distrbution of consumers and producers. If you enable the server affinity in the connection factory then also proper distribution may not happen and consumers/producers may get attached to one physical queue.
    So there are different cases and different configurations when problem may be same but reason would be different, so to find out the exact reason we have to check for all the possible causes.
    Regards,
    Anuj
    Edited by: Anuj Dwivedi on Oct 14, 2010 6:38 PM
    Edited by: Anuj Dwivedi on Oct 14, 2010 6:41 PM

  • Using Basic or Multi-tier configuration for WLS Clusters...

    Ok,
              The scenario is: I'm using WLS6.1 (hopefully, version doesn't matter here)
              with three instances clustered. Each instance provides all Services:
              Servlets / JSPs/ EJBs / Database communication... I'm using the Basic
              configuration described on the BEA documentation....
              Now, I want to move forward to a Multi-tier configuration, where the first
              layer will serve Servlets and JSPs and the second layer will serve EJBs.
              The problem: On the first scenario, I was looking EJBs with the Default
              InitialContext() constructor without the environment, since everybody was on
              the same JVM...
              What do I have to do, so my Servlets start looking for EJBs on the second
              cluster now? Do I have to re-write every single lookup? Can I use a
              jndi.properties file on the first layer - on the presentation tier?
              Thanks in Advance,
              Marcelo.
              

              Thanks Patrick!
              But my actual problem starts here. The Servlets aren't mine. We have to support
              applications which run atop our product(which is a bunch of beans+RMI Objects
              running on the top of WLS) in a backward compatible way with a standalone.
              Will try and make a post if I can find a 'configurable' way out.
              Harish
              Robert Patrick <[email protected]> wrote:
              >Put the other server's PROVIDER_URL in a system property, property file,
              >whatever and
              >have the servlets explicitly use it when creating the InitialContext
              >to talk with the
              >other server...
              >
              >Harish Vajha wrote:
              >
              >> Hi Cameron,
              >>
              >> A -Djava.naming.provider.url nor jndi.properties would work. The problem
              >is like
              >> this:
              >> Say I have two WL servers hosting just EJBs: E1, E2. And I have a single
              >WL Server
              >> hosting just servlets: S1. Now I give the -Djava.naming.provider.url=E1(using
              >> http or t3) (or I provide the same thing using my own jndi.properties).
              >>
              >> The problem with this setup is that while starting up, the Server will
              >try binding
              >> every object(including the System bindings like wl.transaction.TransactionManager,
              >> wl.common.T3Services) to the other NS (in this case E1's naming service)
              >which
              >> is bound to fail, as they're already bound in that Server.
              >>
              >> The solution has to be a way to specify the java.naming.provider.url
              >only for
              >> the servlets (or the web app).
              >>
              >> Any ideas on how to provide a Webapp specific lookup address?
              >>
              >> Marcelo, if you've found a way out to separate, pl. make a post.. Thanks!
              >>
              >> Harish
              >>
              >> "Cameron Purdy" <[email protected]> wrote:
              >> >Hi Marcelo,
              >> >
              >> >With Weblogic, your performance will typically decrease if you go
              >the
              >> >route
              >> >that you are describing.
              >> >
              >> >Yes, you can do jndi.properties, however I believe you will find it
              >inside
              >> >one of the WL jars.
              >> >
              >> >Note that you can use java -D instead to define some of the JNDI properties
              >> >to point to the other cluster, but I can't remember them off-hand.
              >> >
              >> >Peace,
              >> >
              >> >--
              >> >Cameron Purdy
              >> >Tangosol Inc.
              >> ><< Tangosol Server: How Weblogic applications are customized >>
              >> ><< Download now from http://www.tangosol.com/download.jsp >>
              >> >
              >> >
              >> >"Marcelo Caldas" <[email protected]> wrote in message
              >> >news:[email protected]...
              >> >> Ok,
              >> >> The scenario is: I'm using WLS6.1 (hopefully, version doesn't matter
              >> >here)
              >> >> with three instances clustered. Each instance provides all Services:
              >> >> Servlets / JSPs/ EJBs / Database communication... I'm using the
              >Basic
              >> >> configuration described on the BEA documentation....
              >> >>
              >> >> Now, I want to move forward to a Multi-tier configuration, where
              >the
              >> >first
              >> >> layer will serve Servlets and JSPs and the second layer will serve
              >> >EJBs.
              >> >>
              >> >> The problem: On the first scenario, I was looking EJBs with the
              >Default
              >> >> InitialContext() constructor without the environment, since everybody
              >> >was
              >> >on
              >> >> the same JVM...
              >> >> What do I have to do, so my Servlets start looking for EJBs on the
              >> >second
              >> >> cluster now? Do I have to re-write every single lookup? Can I use
              >a
              >> >> jndi.properties file on the first layer - on the presentation tier?
              >> >>
              >> >> Thanks in Advance,
              >> >> Marcelo.
              >> >>
              >> >>
              >> >
              >> >
              >
              

  • Log4j - configuration file

    where can I find a guide on log4j?
    I need to configure the logger, in a configuration file.
    I've done it by a init servlet and a configuration file,but tomcat write this message
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).
    log4j:WARN Please initialize the log4j system properly.
    the servlet is this:
    package fromBegin.controller;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.log4j.PropertyConfigurator;
    public class StartUpServlet extends HttpServlet
    public void init() {
    String prefix = getServletContext().getRealPath("/");
    String file = getInitParameter("log4j-init-file");
    // if the log4j-init-file is not set, then no point in trying
    if(file != null) {
    PropertyConfigurator.configure(prefix+file);
    public
    void doGet(HttpServletRequest req, HttpServletResponse res) {
    the web.xml fragment is this
    <servlet>
    <servlet-name>startUp</servlet-name>
    <servlet-class>fromBegin.controller.StartUpServlet</servlet-class>
    <init-param>
    <param-name>log4j-init-file</param-name>
    <param-value>WEB-INF/log4j.lcf</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    and the configuration file is this:
    # file di configurazione per la registrazione dei log
    # mediante log4j
    log4j.rootLogger=DEBUG, R
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    log4j.appender.R.File=C:\\Documents and Settings\\Romeo\\Desktop\\Raccolta log\\log4j-track.log
    log4j.appender.R.layout=org.apache.log4j.PatternLayout
    log4j.appender.R.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
    finally,
    anybody knows a online guide for log4j?
    why tomcat give me that warning message?
    thanks

    The error message is coming because some other classes that use log4j debugging can't find your properties file.
    In this case the org.apache.commons.digester.Digester.
    It knows nothing about your personal log4j file for your app - you passed that in as a servlet ini parameter.
    That will set up log4j to work for your code, but probably not for others.
    Quick and dirty fix: put another log4j.properties file in your web-inf/classes directory. This will be found by all other applications wanting to use log4j. You can then set their logging levels in this file, seperate from your own.
    Re online log4j documentation- http://logging.apache.org/log4j/docs/documentation.html
    You most probably found that already though :-)
    Good luck,
    evnafets

  • Reload with iPhone Configuration Utility

    How can I reload an app on a iDevice via iPhone Configuration Utility, when I delete the app before, on the same device.

    Get your iPhone Connected via WIFI
    go to http://www.unlockit.co.nz (You will see an iPhone Formatted Website)
    Choose Create APN
    Choose United States
    Choose Straight talk
    Choose Create APN below the Carrier
    This will set the APN Data Settings for Straighttalk.
    This does not jailbreak or hack your iPhone in anyway and the website is used successfully by tens of thousands of people users per day all over the world. It uses the Same method as the iPhone Configuration Utility but some people find the iCU quite hard to use (or they don't know the settings/where to put the settings)

  • OC4J 11 : log4j configuration

    I can't configure log4j to work with OC4J 11. I just copied log4j.jar, log4j.xml to the /j2ee/home/applib , but without results. The same configuration works fine in the JDev 10.1.3.3.
    Can anyone help ?

    I can't configure log4j to work with OC4J 11. I just copied log4j.jar, log4j.xml to the /j2ee/home/applib , but without results. The same configuration works fine in the JDev 10.1.3.3.
    Can anyone help ?

  • Log4j configuration on WAS6.1 Server

    Can any please let us know how to configure log4j.xml file or properties file externally from was server administration. I have deployed an application and have set log4j properties for that applications.
    Please help us
    Thanks in advance.

    I fear you are in the wrong forum... :-D

  • Deployment Problem related to filter, struts and log4j on BEA WLS 8.1 SP4

    Hi to All,
    I have a web application that uses struts 1.1, log4j, axis, filter vs. I have used WLS 8.1 SP4 for 10 months with my application without any problem. But yesterday I can not deploy application, I get the following errors;
    <pre>
    java.lang.NullPointerException
         at weblogic.servlet.internal.WebAppServletContext.destroyFilters(WebAppServletContext.java:6111)
         at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:5999)
         at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:196)
         at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:777)
         at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:761)
         at weblogic.servlet.internal.WebAppModule.rollback(WebAppModule.java:739)
    </pre>
    I research the exception and get some information; duplicate JAR file on classpath or missing JAR file. But i have another application that have two different log4j jar file, commons logging jar file in its web-inf/lib folder. And this application can be deployed without any problem. When I remove filter definition from web.xml, I get following error;
    <pre>
    - Begin event threw exception
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Caused by: java.lang.NoClassDefFoundError: org/apache/struts/validator/ValidatorForm
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    <Jun 2, 2006 4:28:54 PM EEST> <Error> <HTTP> <BEA-101216> <Servlet: "action" failed to preload on startup in Web application: "deneme".
    javax.servlet.UnavailableException: Parsing error processing resource path
         at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)
         at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1014)
         at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
    <Jun 2, 2006 4:28:54 PM EEST> <Error> <HTTP> <BEA-101216> <Servlet: "init" failed to preload on startup in Web application: "deneme".
    javax.servlet.ServletException: org/apache/log4j/Logger
         at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:919)
         at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822)
    </pre>
    I can not find a solution, anyone can help me?
    Thanks for answers.
    Message was edited by:
    mucahitkurt

    Hi,
    It seems to be some of the files did not sign in the jar that may be cause for this type of error.
    Make sure that whether all files were signed or not in jar.
    Regards
    Anilkumar kari

  • How to set up multiple log4j configurations for multiple WAR packages?

    hi all,
    the EAR that i am trying to deploy has multiple WARs.
    I need to configure separate loggers for each these WARs.
    Could any of experts can help me out.

    Hi
    Depending on your needs, you may find that Set level offers the best approach:
    Within a Set you have the Playbacks (Set Level, so they work for the entire set) with individual patches in the set "live" for the EWI etc as needed.
    You need only map one set of controls for all the Playbacks since only 1 set can run at a time.
    CCT

  • Problem faced while configuring the domain configuration in WLS 10.0

    Hi all, I am trying to set up a Weblogic server 10.0 web application development environment in which we use persistence store, jms server, jms system module, subdeployments and jms system resources. when i configure everything and activate the changes, i get weird exception. but, i could not figure out why it happens. this is the exception
    weblogic.store.io.jdbc.JDBCStoreException: [Store:280064]Expected empty table. (server="AdminServer" store="limJMSPersistentStore" table="limJMSWLStore")
         at weblogic.store.io.jdbc.JDBCStoreIO.initializeEmptyTable(JDBCStoreIO.java:656)
         at weblogic.store.io.jdbc.JDBCStoreIO.open(JDBCStoreIO.java:375)
         at weblogic.store.internal.PersistentStoreImpl.recoverStoreConnections(PersistentStoreImpl.java:327)
         at weblogic.store.internal.PersistentStoreImpl.open(PersistentStoreImpl.java:318)
    It says weblogic.management.DeploymentException: The persistent store "limJMSPersistentStore" does not exist. but it is configured in the domain when i see in console. After that all the resources to jms system module also throws the below exception
    weblogic.application.ModuleException: ERROR: Could not activate limJMSSystemModule!limLidbResponseQueue
    reason is weblogic.messaging.kernel.KernelException: The Messaging Kernel limJMSServer has not yet been opened. I also have another problem with resource bundle properties file. weblogic server could not find the properties file. it throws MissingresourceException for all the properties file. i have placed the properties file inside DOMAIN_HOME/app_classes folder

    Hi all,
    The deployment failure of the "limJMSPersistenceStore" - jdbc store was the root cause. I use "limjms" prefix for this persistence store.It was not able to persist because of the data present in the "limJMSWLStore" table in the db schema. when i deleted all the rows and committed. then, restarted the server. Everything worked just fine :). Thanks!

  • URGENT: external LDAP configuration from WLS 6.1

    Hi,
    I am trying to configure the LDAP Realm(Netscape directory server) for Weblogic
    Server6.1. For any user to perform a bind
    on my Directory Server it needs CN + serial number. But the Users actually don't
    know all this and they use LoginID (which is unique in LDAP) in Login Screens.
    How do I configure the
    BEA server or how do I achieve this (please listout the steps).
    DO I need to write a custom realm?
    Thanks in Advance,
    Srinivas

    Hi,
    I am trying to configure the LDAP Realm(Netscape directory server) for Weblogic
    Server6.1. For any user to perform a bind
    on my Directory Server it needs CN + serial number. But the Users actually don't
    know all this and they use LoginID (which is unique in LDAP) in Login Screens.
    How do I configure the
    BEA server or how do I achieve this (please listout the steps).
    DO I need to write a custom realm?
    Thanks in Advance,
    Srinivas

Maybe you are looking for