Configure the log4j.xml file

Hello All,
I am trying to configure the log4j.xml file, so that i can get differnet logging messages based on the level to different log files. for ex: info messages in info.log, debug messages in debug.log and so on...i tried using the below...but, no luck.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="UCF_Exception" class="org.apache.log4j.RollingFileAppender">
     <param name="File" value="UCF_Exception.log"/>
     <param name="Append" value="false"/>
     <param name="MaxFileSize" value="1000KB"/>
     <param name="MaxBackupIndex" value="2"/>
     <layout class="org.apache.log4j.xml.XMLLayout">
          <param name="LocationInfo" value="true"/>
     </layout>
</appender>
<log4j.logger.UCFExceptionLogger>
     <level value ="debug"/>
     <appender-ref ref="UCF_Exception" />
</log4j.logger.UCFExceptionLogger>
</log4j:configuration>
getting exception
log4j:WARN No appenders could be found for logger (UCFExceptionLogger).
log4j:WARN Please initialize the log4j system properly.
Can someone help me...

I'm not 100% sure this is possible with log4j, but if it is then you've still got some errors in your log4j.xml file
Change
<log4j.logger.UCFExceptionLogger>
   <level value ="debug"/>
   <appender-ref ref="UCF_Exception" />
</log4j.logger.UCFExceptionLogger>to
<logger name="UCFExceptionLogger>
   <level value="debug"/>
   <appender-ref ref="UCF_Exception" />
</logger>
The log4j jar includes a DTD. You can use the free version of XMLSpy to validate your log4j.xml file against it.
Steve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How i configure the log4j.xml in weblogic server

    hi
    i write a new lg4j.xml and i put this in WEB-INF/classes,i deployed this jar in my remote server,but it not reflected. [i am not specify the server logs, we have some API's which is deployed in server for that API log files is configured using log4j.xml ]
    i saw there is a option in weblogic - setDomain -LOG4J_CONFIG_FILE='here we give the path for log4j.xml'.I think it's only work for local machines not for the remote machines.
    i don't know how to get a log files in weblogic server

    To use Quartz primarily within an application server environment,include the Quartz JAR within the enterprise application (.ear or .war file). However, if you want to make Quartz available to many applications then simply make sure it's on the classpath of your appserver.
    You can also deploy it as a jar file or a library module as required.
    Quartz depends on a number of third-party libraries (in the form of jars) which are included in the distribution .zip file in the 'lib' directory. To use all the features of Quartz, all of these jars must also exist on your classpath.
    -Sandeep

  • Configuring the Logconfig.xml file

    I would like to configure the Logconfig.xml(for presentation services) so that the log file that is created is in the format of the log file that is generated by usage tracking(comma separated values) or store it directly to the table.
    Is it possible?
    where can i find some detailed information about the various writers(filelogwriter,coutwriter)

    I will try to make it clearer:
    The server I have access to runs Tomcat through Apache. The only way I can access files is if I put them under httdocs.
    The question is quite simple: without having my clueless host remap everything, how can I access files in the Tomcat directory, where those files rightly belong?
    There should be a simple way to do it in a web.xml file, but have been unsuccessful thus far.

  • Configure the persistence.xml file

    Hi experts,
    i want to develop a little JPA-Project in the NWDS 7.3. It was no problem to create entities but i dont know how to configure the persistence.xml-flie to get a connection to the database.? I use an Oracle database.
    Thanks in advance

    I solved the problem. I had no database connection.
    Edited by: jtrebess on Oct 13, 2011 9:28 AM

  • Configuring the config.xml file path

    Hi All,
    I am calling a startWebLogic script from another script as 'root'.When the other script calls the startWebLogic script it is reading config.xml path as /opt/bea/./config.xml and is giving errors.
    It is taking the default path as /opt/bea .Where should I specify the correct path.
    Thanks
    sandhya

    Better post this question at a Struts related forum. There is a mailinglist at their own homepage and a forum at Nabble.com.

  • How to configure a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I wrestled with this for a long time. I may have done something wrong, but to get my mySQL JDNI reference to work, I had to add it to the server.xml file. You can try with web.xml, but I eventually just got frustrated and put it in server.xml.
    The following is between two <context> tags:
    <Resource name="jdbc/instance_name_goes_here"
                   auth="Container"
                   type="javax.sql.DataSource"/>
              <ResourceParams name="jdbc/same_instance_name_here">
                   <parameter>
                        <name>username</name>
                        <value>user_name_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>password</name>
                        <value>password_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>driverClassName</name>
                        <value>jdbc_fully_qualified_class_name</value>
                   </parameter>
                   <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
                   <parameter>
                        <name>url</name>
                        <value>jdbc_connect_url_database_vendor_specific</value>
                   </parameter>
                   <parameter>
                        <name>maxActive</name>
                        <value>8</value>
                   </parameter>
                   <parameter>
                        <name>maxIdle</name>
                        <value>8</value>
                   </parameter>
              </ResourceParams>
    - Saish
    "My karma ran over your dogma." - Anon

  • Error after reload the standard XML file in UWL Configuration Wizard

    Hi all,
    We are working with UWL (EP7sp10) and encountered a problem. The UWL Configuration Wizard gave an error. We found on SDN/WIKI a posting with a workaround (<a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/BPX/UWL%2bConfiguration%2bWizard%2bshows%2bempty%2bdropdown">WIKI - UWL Configuration Wizard shows empty dropdown</a>)
    We tried this working around, but it did not work. We uploaded the standard XML file again. Now we cannot access the link "Customize the look of the UWL main page" in UWL Administration.
    We get a shortdump: 500   Internal Server Error
    <b>LOGS & TRACES</b>
    Exception occured during processing of Web Dynpro application sap.com/tckmcbc.uwl.ui~wd_admin/UWLControlCenterConfiguration. The causing exception is nested.
    [EXCEPTION]
    com.sap.tc.webdynpro.progmodel.context.ContextException: dropDownEntry<u>ComboMaincom</u>.sap.pct.erp.mss.Alert</u> is not a valid name for a node or attribute
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.validateName(NodeInfo.java:973)
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.addAttribute(NodeInfo.java:513)
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.addAttribute(NodeInfo.java:534)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.createTab(NavigationNodeConfiguration.java:830)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.populateTabs(NavigationNodeConfiguration.java:945)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.onActionFirstLevelNodeSelected(NavigationNodeConfiguration.java:252)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.NavigationNodeConfiguration.onPlugfromListOfConfigurations(NavigationNodeConfiguration.java:223)
    at com.sap.netweaver.bc.uwl.ui.admin.wizard.wdp.InternalNavigationNodeConfiguration.wdInvokeEventHandler(InternalNavigationNodeConfiguration.java:288)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
    at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:873)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
    at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:144)
    at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
    at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:752)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:705)
    at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
    at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:154)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    It seems getting wrong at: dropDownEntryComboMaincom.sap.pct.erp.mss.Alert
    What do I have to do now? Also a clean XML file upload from another SNP installation did not work. 
    Best regards,
    G. Leurs
    Message was edited by:
            G. Leurs
    Message was edited by:
            G. Leurs

    Hi Leurs,
          Try doing the following:
         1. Upload the new Standard XML file from the another portal server with same support version or replace the changes u made to original and upload
         2. Remove the cache
        3. Register for all systems
        4. preview the UWL iView.
    Regards,
    Vinoth.M

  • Configuring a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I'm pretty sure you can't do it that way round. The logic of the thing is that database access URLs etc. tend to depend on the where the server is. The whole idea of these resources is to put the stuff that's specific to the server in server.xml and refer to it using names that should remain the same if you deploy your webapp on another server. Of, for example, you have test, stage and production servers running the same webapps but connecting to different databases.

  • Problem while loading the log4j.xml in to the classpath

    Hi,
    I am working with a web application using tomcat5.0.I am using log4j for logging the information in my application.I am keeping log4j.xml out side of the application(Generally we will keep under WEB-INF/classes ).Now I want to load the log4j.xml from outside location in my ContextListner class.I am using the following code.
    String cmd="java -cp -Dlog4j.configuration=C:/sample/log4j.xml";
                   Runtime runtime = Runtime.getRuntime();
                   Process process = null;
                   process = runtime.exec(cmd);  but I am getting the following errors.
    log4j:WARN File option not set for appender [stdout].
    log4j:WARN Are you using FileAppender instead of ConsoleAppender?
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    log4j:ERROR No output stream or file set for the appender named [stdout].
    Feb 26, 2009 7:48:28 PM org.apache.coyote.http11.Http11BaseProtocol startI am not getting where am I doing wrong.
    Any Ideas please?
    Regards
    kondal

    My log4j.xml looks like
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
         <appender name="file" class="org.apache.log4j.RollingFileAppender">
              <param name="File" value="C:\\niablogs\\niab3.log"/>
            <param name="MaxFileSize" value="1MB"/>
            <param name="append" value="true"/>
            <param name="MaxBackupIndex" value="5"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="(%-25.25F:%4L) %d{yyyy MM dd HH:mm:ss:SSS} [%-30.30t] %5p - %m %n" />
              </layout>
         </appender>
        <logger name="in.co" additivity="false">
            <level value="all" />
            <appender-ref ref="file" />
        </logger>
    </log4j:configuration>It is working fine if I keep log4j.xml under WEB-INF/classes.If I keep my log4j.xml is outside of the application then it is not working.As per ApacheLog4j Specification we need to set the xml file path to the log4j.configuration system property.Even I tried putting like the following in my Listener class System.setProperty("log4j.configuration", "C:/kondal/log4j.xml");.
    Any Ideas please?
    Thanks
    kondal

  • Possible elements in the instanceconfig.xml file for presentation services

    g'day
    Has anyone here come across a list of all the possible elements that can be put in the configuration file for a presentation service, instanceconfig.xml ?<P>
    I have found next to nothing in the documentations, about what can be configured there.<P>
    What I am specifically after is: How can I change the default listening port for the Presentation Service? The default port is 9710 and I want to move to another port.<P>
    Also, how can I move the JavaHost from the default port 9810? I can change the file <i>OracleBI/web/javahost/config/config.xml</i> to reflect the change. Once the JavaHost has been restarted it starts up on the expected port, but the Presentation Service still tries to communicate over RPC to port 9810. How do I configure the presentation service to search for the JavaHost on a non-default port?<P>
    I have boiled it down to my original question: What are the possible values I can configure in the instanceconfig.xml file?<P>
    Any comments here would be great.<P>
    Cheers,<br>
    Borkur

    So, I had a little breakthrough here.
    I found in the OBIEE deployment guide, page 142:
    To change the Presentation Services listener port
    1 Open the instanceconfig.xml file for editing.
    2 Locate the <WebConfig> element.
    3 Within the <WebConfig> tags, create the element <RPC> and assign it the RPC Listener Port
    value for the BI Presentation Services instance, as shown in the following example.
    <WebConfig>
    <ServerInstance>
    <RPC>
    <Listener port="9715" />
    </RPC>
    </ServerInstance>
    </WebConfig>
    NOTE: In the preceding example, the RPC Listener port for the BI Presentation Services instance
    has been changed to port 9715 from the default of 9710.
    4 Save changes to the file.
    This almost works. The RPC element has been deprecated, as was reported in the sawserver.out.log:
    The configuration entry 'RPC/Listener' is deprecated. Please refer to the admin guide for more information.
    What I then did was to just remove the RPC elements and leaving the Listener element straight under there ServerInstance element. This seems to have solved the problem.
    I still have to figure out how to let the Presentation Service know that I have moved the JavaHost to antoher port ...
    Cheers,
    Borkur

  • How can I get the directory.xml file for WL6.0?

    I have installed the ALBPM Enterprise WL6.01 and started it in my server.But I get the error message when I login.
    directory configuration runtime fails to initilize with
    resource:/Aqualogic/j2eewl/tomcate/webapps/../../webapps/webconsole/WEB-INF/directory.xml
    How can I get the XML file?

    aaa, ok i misunderstood your first post, i thought you are talking about unable to use the directory.xml from your application.
    Ok, well the directory.xml file that ALBPM uses is allways in /albpm6.0/j2eewl/conf/directory.xml if we are not talking about Standalone. And when you start your albpm server it picks up the directory.xml file from there. But it picks him up only when you start it...so if you made any changes to it, you have to restart the server.
    You should check the instalation folder of your ALBPM.
    If you want to change the user/pass in the directory.xml change it in that folder and restart ALBPM.
    If you don't know how to enter new password you have to use this sintax:
    <encrypt>newPassword</encrypt>
    Because if you open the xml file you have only <encrypted> tags, and you can't change those.
    I don't know what the xml file is doing in that tomcat folder though...maybe it get's copied to that location when you start the albpm WL
    Hope this helps
    Edited by Lex_ at 12/13/2007 10:27 PM

  • Receiver determination based on the filename of the incoming xml file

    hi folks,
    is it possible to base the receiver determination from the filename (pattern) of the incoming xml file?
    suppose, if the filename is partner1.xml, then the receiver determination has a condition of partner1.  in this case, the message is received by partner1.
    any advise please?
    thanks!
    -lex

    Hi Lex,
    You can use Enhanced Receiver Determination for this. Do your normal mapping from source to target. And another mapping for the receiver determination. In that mapping you can use the UDF for Dynamic Configuration and set the filename as the receiver service name.
    Use the following blog for Enhanced Receiver Determination:
    /people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16
    This blog explains the usage of Dynamic Configuration:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Sanjeev.

  • Anybody know what's up with the menu.xml.files not being available for DW after installing on a new comp?

    Anybody know what's up with the menu.xml.files not being available for DW after installing on a new comp?

    Usually that error can be cleared up by renaming the personal config folder. Turn on your OS's hidden files and then go to...
    C: > Users > your username > AppData > Roaming > Dreamweaver (version) > your language > configuration
    Rename the configuration folder configuration-old and start DW up. That should create an entirely new configuration folder and correct the menu.xml file.

  • Multiple log4j.xml files for single application.

    Hi All,
    How to use multiple log4j.xml files for single application?
    I do have a pluggable application modules. ie, If I add a jar I will get some functionalities. Like that i do have many jars.
    Log4j.xml also will be present in that jar only. So if I add multiple jar files like this, I will get multiple log4j.xml files. What should I do?

    Each logger can have its own file I think. Check the log4j documentation.

  • [svn:osmf:] 17548: Remove left-over event handler, which could trigger an unnecessary event if a player loaded plugins through the config XML file and manually  (e.g.

    Revision: 17548
    Revision: 17548
    Author:   [email protected]
    Date:     2010-09-01 14:09:14 -0700 (Wed, 01 Sep 2010)
    Log Message:
    Remove left-over event handler, which could trigger an unnecessary event if a player loaded plugins through the config XML file and manually (e.g. for static plugins).
    Modified Paths:
        osmf/trunk/libs/samples/ChromeLibrary/org/osmf/chrome/configuration/PluginsParser.as

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

Maybe you are looking for

  • I am getting internal server error when I try to add my points on the weight watchers website. How do I resolve this??

    Does anybody know how to fix internal server error?  This has never happened before?

  • Variable length ByteBuffer?

    I have a client sending a ByteBuffer to a server. I know the size of the ByteBuffer on the client based on the file I'm reading in. However when I'm on the server reading in the ByteBuffer I don't know the size. Since the file size on the client can

  • Create view dynamically

    Please help me find out why the following code gave the error: ORA-00903: invalid table name sql_stmt := 'CREATE OR REPLACE VIEW re_temp AS SELECT * FROM :1 || ''.'' || :2 || ''@dbLink '''; EXECUTE IMMEDIATE sql_stmt USING v_sc, v_tb; Thanks for your

  • [CF10] CFINPUT custom validation start and end dates

    Hello, everyone, Another developer that I am working with is working with a form that has start and end dates.  He'd like to be able to use custom JavaScript validation to make sure that not only are the dates in proper format (that part of the JS is

  • IMovie Vs Final Cut Express/pro and making$$$?

    Sorry, another post from us (interchangeably Graeme or Leanne). We have been making home movies with various versions of iMovie for about 5 years now and for the most part (except the bugs) love it. Recently we have decided to try and start using our