Log4j.properties ???

hi,
I'm currently working with applets and try to call a web service from my applet. I receive this error message :
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
Does somebody know where I have to declare this log4j.properties file ? Do I have to configure something by the client ?
Finally does somebody know if it is possible to call web services from an applet (I mean on the same host) without using signed applets ????
TU
PA
http://www.doffoel.com

I believe that the log4j.properties file has to be in
your classpath.
and in an applet, this means placing log4j.properties in the root of your applet's JAR file.
The problem you are going to run into, though, is what you are going to do with the logging information. Unless you sign the applet, you won't be able to write the log to disk... I suppose there might be an appender that could write back to your server (or you could implement one), but I'm not sure that's going to do what you are trying for...
- K

Similar Messages

  • File not found error with log4j.properties

    Hi,
    I'm writing a web service on weblogic 8.1 with weblogic workshop.I have to use log4j-1.2.7 supplied by client with my application.I cannot write ant script manually.Also I cannot change server start script or cannot put any command line argument when the server starts.
    Now I require this logger in my EJB.I have kept log4j.properties in the same path where my EJB's are.But the final ear produced does not contain this log4j.properties and subsequently I get the error "log4j:ERROR Could not read configuration file [log4j.properties]."
    Please help me to resolve this problem so that log4j.properties goes with the final .ear file and the ejb code finds the logger.
    thanks,
    pratim

    Hello,
    I am having a similar problem. Did you find a solution?
    Thank you,
    Melissa
    "arunak" <[email protected]> wrote:
    >
    Hi Pratim,
    I am also facing the same problem. can u please let me know whenever
    u get the
    solution for this.
    Regards,
    Arunak
    Pratim <[email protected]> wrote:
    Hi,
    I'm writing a web service on weblogic 8.1 with weblogic workshop.Ihave
    to use log4j-1.2.7 supplied by client with my application.I cannot write
    ant script manually.Also I cannot change server start script or cannot
    put any command line argument when the server starts.
    Now I require this logger in my EJB.I have kept log4j.properties inthe
    same path where my EJB's are.But the final ear produced does not contain
    this log4j.properties and subsequently I get the error "log4j:ERROR
    Could not read configuration file [log4j.properties]."
    Please help me to resolve this problem so that log4j.properties goes
    with the final .ear file and the ejb code finds the logger.
    thanks,
    pratim

  • Cost involved in changing the code using log4j.properties to log4j.xml

    i have finished my application, and it was done in such a way that logging is done using log4j but it was using log4j.properties file.
    now i need to change it to log4j.xml. i need to do this at the earliest. so i need to know the cost involved in it?. do i need to change a lot on my app to read the log4j.xml?. In my app there is a function named getProperties, which actually reads the log4j.properties file.
    this is the code of that function
    public static Properties getProperties(String filename,String path) throws myException
    //InputStream is = null;
    FileInputStream is=null;
            Properties props = new Properties();       
            //ClassLoader classLoader = ResourceUtil.class.getClassLoader();
            //is = classLoader.getResourceAsStream(filename);
            File catalinaHome = new  File(System.getProperty("catalina.home"));     
            try {       
    is=new
    FileInputStream(catalinaHome.getCanonicalFile()+path + filename);
    } catch (IOException e) {
            if(is == null)
                String message = "Cannot locate property file " + filename + " in the classpath";
                log.error(message);
            throw new myException(message);
            try
                props.load(is);
            catch (IOException e)
                String message = "Error reading property file " + filename;
                log.error(message);
            throw new myException(message, e);
            finally
                try
                    is.close();
                catch(Throwable t)
                    t.printStackTrace();
            if(props.isEmpty())
                String message = "No properties are defined in " + filename;
                log.error(message);
            throw new myException(message);
            return props;       
    }and my initialize function is
    public static void initialize()
    Properties properties=null;
    try {
    String path="/properties/";
    properties=ResourceUtil.getProperties("log4j.properties",path);
    } catch (myException e2) {
    e2.printStackTrace();
    PropertyConfigurator.configure(properties);
    }Message was edited by:
    xema
    Message was edited by:
    xema
    Message was edited by:
    xema

    >
    1. Restructure log4j.properties into log4j.xml.
    thats done
    2. Move log4j.xml into a directory that's in the
    classpath.
    actually i donot understand what does it mean to move in a directory thats in classpath means. i have to use logging in my webapplication running in tomcat. and my log4j.xml has to reside in catalina.home/properties/. My log4j.properties have been residing here and it had worked well woth the previous function. Now what i did is placed the log4j.xml under properties folder. Now tell me what modifications should i make in the above code.
    3. Remove any code that explicitly configures log4j
    (i.e. the initialize() method) because log4j will
    configure itself from any properties file it finds in
    the classpath, automatically, the first time it is
    called.I prefer not remvoing this function as this function is being called in many of my classes... and we don't have time to edit all...
    please help... and excuse me if i asked some blunders.!!!

  • Configuring directory path for fileappender in log4j.properties

    I want to write log data to a file where the directory path of the file should be picked from a unix environmental variable. How can you configure this in log4j.properties?
    log4j.rootLogger=INFO, A
    # A is set to be a FileAppender.
    log4j.appender.A=org.apache.log4j.FileAppender
    # A uses PatternLayout.
    log4j.appender.A.File=$UNIX_ENV_VARIABLE/A.log <= This is what I want. The dir path should be picked from some env path
    log4j.appender.A.layout=org.apache.log4j.PatternLayout
    log4j.appender.A.layout.ConversionPattern=%d{HH:mm:ss,SSS} [%t] %-5p %c %x - %m%n
    Or if this should be done in code, then please guide me on that.
    Thanks in advance

    Hi,
    i am facing one problem,
    where today's log and yesterday log has log statements for today with same date.. but different data. any one pls help.
    this is the properties i configured
    # Logger for A messages
    log4j.logger.A=debug, A_R1
    log4j.appender.A_R1=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.A_R1.File=/var/opt/wmeaidata/app_data/log4j/logs/eai_a.log
    log4j.appender.A_R1.MaxFileSize = 5MB
    log4j.appender.A_R1.MaxBackupIndex = 3
    log4j.appender.A_R1.layout=org.apache.log4j.PatternLayout
    log4j.appender.A_R1.layout.ConversionPattern=%d{MMM dd, yyyy hh:mm:ss a}|%c-%X{host}|%m%n
    Thanks
    venkat

  • A question about log4j.properties

    Normally I put the log4j.properties inside my web-application such as under WEB-INF. So it will be packaged into the WAR.
    But now I want to take it outside of the WAR and put it under a dir and furthermore I change its name to "myLog4j.log4j.properties". This has two advantages:
    1.
    One can change the contents without opent the WAR.
    2.
    Under this dir the other projects can put their xxx.log4j.properties so they can be managed easily.
    But I don't know where should I put this file and how to configure the server sothat the server can find this file and my program can write all the log infos into the log-file defined in the "myLog4j.log4j.properties".
    Can someone help?
    Regards

    Actually file log4j.properties should be in the classpath, that classloader could see it. Add the path to file into CLASSPATH.
    Thanks

  • Log4j.properties or log4j.xml Not Reading

    Hello,
    I am trying to use log4j in jsp.
    I have added log4j.properties in /WEB-INF/log4j.properties.
    And in jsp page, I added like
    Logger logger = Logger.getLogger("test1.jsp");When I run jsp page, I get
    log4j:WARN No appenders could be found for logger (test1.jsp).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.Is this the right place to keep log4j.properties file? Does java classes can read if I put under /WEB-INF folder?
    If I am using log4j.xml where to keep this file?
    Regards
    Edited by: Chackochen on Aug 14, 2010 1:19 AM
    Edited by: Chackochen on Aug 14, 2010 1:20 AM

    Here is what I figured:
    add properties to the workspace/WEIB-INF/directory.xml and then read them from the PAPI code using
         String myProp = DirectoryConfigurationManager.getRuntime("default").getConfigurationProperty("categoryName", "propKey");

  • Problem with log4j.properties and level DEBUG

    Hi,
    I need some log4j help.
    I create 2 different appenders in the log4j.properties file
    and it works.
    This is my complete log4j.properties:
    log4j.logger.log1=DEBUG, log1
    log4j.logger.log2=DEBUG, log2
    log4j.appender.log1=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.log1.File=${StandardLogPath}
    log4j.appender.log1.DatePattern='.'yyyy-MM-dd
    log4j.appender.log1.Append=true
    #log4j.appender.log1.Threshold=DEBUG
    log4j.appender.log1.layout=org.apache.log4j.PatternLayout
    log4j.appender.log1.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} [%-5p] %-25c{1} %m%n
    log4j.appender.log2=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.log2.File=${StandardLogQueryPath}
    log4j.appender.log2.DatePattern='.'yyyy-MM-dd
    log4j.appender.log2.Append=true
    log4j.appender.log2.layout=org.apache.log4j.PatternLayout
    log4j.appender.log2.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} [%-5p] %-25c{1} %m%nAnd here's my logging code:
    import org.apache.log4j.Logger;
    Logger log = Logger.getLogger("log1");
    Logger logQuery = Logger.getLogger("log2");
    log.debug("loggerDebug");
    logQuery.debug("loggerDebug");
    log.info("loggerInfo");
    logQuery.info("loggerInfo");The problem is that "loggerDebug" is not written to all appenders (only "loggerInfo").
    In fact if I print:
    System.out.println( log.getEffectiveLevel().toString() );result that the level is INFO and I known that if level is INFO then DEBUG is disable.
    But why the level is INFO????
    Someone can suggest me a solution?
    Thank you very much

    You're so over-sensitive you: when an OP doesn't respond anymore
    to your last reply it implies that you've solved the problem and
    (implicitly) that the OP is very grateful to you. Why do you always
    have to be so explicit about matters? ;-)
    Because I'm not one of those Dutch people ;-)Yes, that's us, the Dutch: mysteriously smiling and keeping silent all the
    time. That's why they call us the Asians of Western Europe ;-)
    ps. There are nice exception to the rule sometimes though.
    Yes, and unfortunately they do seem to be the exception rather than
    the rule. It would be nice to catch one a bit more often.True; that's the internet generation: grab all the information that you can
    and don't give a f*ck about the guy who supplied the information. It's sad
    indeed.
    Maybe we should start a support group where we could thank each
    other now and then 'on behalf' of those little spoiled brats and complain
    about all those bad manners nowadays ;-)
    kind regards,
    Jos

  • JMS Appender in log4j.properties ??

    Hie Experts,
    I have setup a logging mechanism to log messages asynchronously using JMS queue.
    Currently, I am doing this as a call to a method.
    Inside the method, I am
    - creating a JNDI context,
    - retrieve queue connection factory,
    - create a queue session, create a queue sender and
    - associate to the retrieved queue.
    - Finally I send the message and close the queue.
    I do not think that this is the best strategy because:
    1. Queue gets initialized for all logging (making it slower)
    2. I believe that there must be a simpler way such as adding a JMS appender in log4j.properties
    Please advise if there is a better strategy.
    Thanks,
    V Chitkara

    Hi Vishal,
    You are correct in your assumption that there is a simpler way to perform logging using JMS.
    The Log4J project already contains a JMS appender. Take a look at this page:
    http://logging.apache.org/log4j/docs/manual.html
    And search it for "JMS".
    Hope this helps,
    Tom Jenkinson
    Arjuna Technologies Limited

  • Editing log4j.properties file of ear while deploying ear file.

    Hi,
    Can i edit log4j.properties file of ear while deploying ear file.
    ~ Dhiraj.

    javainstead:
    >>is MyFolder in the root? else you mite wanna try giving the entire path starting from the root
    No the "MyFolder" is not in the root. Normally if we give the file name alone, it will store in a directory. Instead of storing in that directory, i want to have create another subfolder under that directory and storing the file in it. This is my need.
    OS: Windows 2000.
    zakir_sh:
    log4j.rootCategory=DEBUG,myproj
    log4j.appender.myproj=org.apache.log4j.RollingFileAppender
    log4j.appender.myproj.File=/u3/logs/myproj_webapp_logs/dev_region/mylogfile.log......
    I gave relative path like this and got the file not found error.
    log4j.appender.myproj.File=/MyFolder/error_file.log
    Thanks,
    Manikandan

  • How to load log4j.properties

    how to load log4j.properties file in my java code ?
    i have put log4j.properties in c:\property\log4j.properties directory.
    how do i load this properties file ?

    Normally you don't have to load it explicitely at
    all. Just place it in your classpath and use log4j,
    it should be loaded automagically.so, at run time i should use
    java -classpath .;c:\property\log4j.properties;c:\log4j.jar; MyClass
    is this the syntax ?

  • WS32 - proper location for log4j.properties?

    Greetings,
    I am running WS3.2 and I have a log4j.properties file located in /resources/* within the IDE.
    As long as I manually copy the file into the "java/classes" directory the file is picked up at runtime.
    Ideally, Workshop should be automagically grabbing the properties file and placing it on the classpath when I "run" the application.
    Is there a workaround for this (besides the manual copy)?
    Is this a defect or am I doing something quite stupid?
    much thks!

    Ok - I've figured this one out.
    The Log4j.properties file needs to reside at:
    web/WEB-INF/src/java.
    Workshop 3.2 DOES copy the file over to the classes director but since I had it in a subfolder called "resources" it wasn't being picked up.

  • Log4j properties configuration problem

    Hi all,
    I have problem to configure properties , below is sample configuration i used :
    log4j.rootCategory=,R1,R2
    #configuration for trace
    log4j.appender.R1.Threshold=DEBUG
    log4j.appender.R1=org.apache.log4j.FileAppender
    log4j.appender.R1.File=trace.out
    log4j.appender.R1.layout=org.apache.log4j.PatternLayout
    log4j.appender.R1.layout.ConversionPattern=%p %d{dd MMM yyyy HH:mm:ss} %m
    log4j.appender.R1=org.apache.log4j.RollingFileAppender
    #configuration for error
    log4j.appender.R2.Threshold=ERROR
    log4j.appender.R2=org.apache.log4j.FileAppender
    log4j.appender.R2.File=error.out
    log4j.appender.R2.layout=org.apache.log4j.PatternLayout
    log4j.appender.R2.layout.ConversionPattern=%p %d{dd MMM yyyy HH:mm:ss} %m
    log4j.appender.R2=org.apache.log4j.RollingFileAppender
    How to disable error log in trace.out file , i want to error log only in error.out file, but acctualy error log still appears in trace.out.
    thanks all

    avoid setting Threshold. instead use a specific logger in your class for errors:
    public final static Logger sysErrLog = Logger.getLogger("SystemError");
    and configure this logger in the log4j.properties:
    log4j.logger.SystemError=ERROR, SystemErrorLogFile
    log4j.additivity.SystemError=false
    log4j.appender.SystemErrorLogFile=org.apache.log4j.RollingFileAppender
    log4j.appender.SystemErrorLogFile.File=${LogDir}/systemerror.log
    log4j.appender.SystemErrorLogFile.append=true
    log4j.appender.SystemErrorLogFile.layout=org.apache.log4j.PatternLayout
    log4j.appender.SystemErrorLogFile.layout.ConversionPattern=%d{ISO8601} %c{2} - %m%n
    log4j.appender.SystemErrorLogFile.MaxFileSize=1000KB
    log4j.appender.SystemErrorLogFile.MaxBackupIndex=3

  • Log4j.properties location

    Hello,
    I want my web application uses a log4j.properties file located in a directory outside Tomcat, in /var/app/conf/.
    I'm using the PropertyConfigurator to configure log4j. If I put log4j.properties in the WEB-INF/classes directory all works fine, but if I put it in the "external" directory works but I get these warnings:
    log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
    How could I avoid these warnings?
    Thanks!

    I am putting log4j.properties file in same folder
    where the java class file is, it's working fine. If
    i'm puting it in some different folder (folder is on
    class path) it's giving the proper output as log file
    but throwing exception at console as:I don't think it's the location of the java class, but rather
    where you are when you run the program. I'm running
    junit tests from within eclipse, and need to put the file
    one directory above my "com" directory. From the
    command line, the properties file just needs to be in
    the current directory. Perhaps using a fully qualified
    path name will solve your problem; no matter where
    you run the program, the file will be found. This
    assumes you have access to a fully qualified location
    (probably bad). Best to determine from where the
    program will be run, and place the file in a relative
    directory off of that (perhaps at deploy time).
    Cheers,
    Brian

  • Log4j.properties with OAF R12

    I am writing OAF R12 components that integrate/extend existing R12 pages.
    I need to deploy a log4j.properties file for logging. I have a dependent jar file that uses log4j. This file is usually placed on the classpath in WEB-INF/classes for a servlet application.
    Where should I place this log4j.properties file so that the OAF R12 container (oc4j) reads this file when processing. I tried to add it to the CLASSPATH. I edited orion_application_xml_1013.tmp and placed the log4j.properties in $JAVA_TOP and added lines for the <library path> as
    <library path="$JAVA_TOP/log4j.properties" /> or
    <library path="%s_javatop%/log4j.properties" />
    and restarted the server.
    However, the log file defined in log4j.properties is not created when running the OAF framework and exercising the integrated code that includes log4j logging.
    What is the best way to integrate this properties file?
    Thanks,
    Ken

    gday Ken --
    If you are OAF R12 wouldn't there be an Oracle standard for logging you should be using? I'd be asking the OAF team for more details.
    Then I'd ask whether using log4j is worth the extra effort over using the Java standard logging API -- the container itself is using Java standard logging API, for which we have the ability to dynamically adjust log levels, view the logs, etc.
    Here are some links to some notes I wrote up recently on using log4j with OC4J (and also using Java standard logging API) :
    http://buttso.blogspot.com/2007/09/directing-log-messages-into-oc4j.html
    http://buttso.blogspot.com/2007/09/directing-log4j-logs-into-oc4j-logging.html
    http://buttso.blogspot.com/2007/09/using-shared-libraries-to-configure.html
    -steve-

  • Very weird issue with server logging when using log4j.properties file

    I'm using log4j logging. In log4j.properties the root logger is set up to use the ServerLoggingAppender class so that all our application logs go to the main server logfile. In addition, there are several appenders defined for specific components, with output going to specific per-component log files. Everything is going fine until I launch the server console. At this point all of those per-component log files get wiped out (zero length) and some non-ASCII lines are written to at least one of these files, after which the logs appear to be fine. The main server log file does not appear to be affected (because the root logger is set to "warn" level, while component-specific loggers are set to trace, the contents in these files is different; however I tried disabling all the other appenders and turning the root logger up to trace, and that still did not re-create the problem in the main server log file.
    And here's the really weird part -- if I use the same configuration, but in a log4j.xml file, the problem does not happen.

    Figured it out.
    We were passing in the configuration for log4j as -Dlog4j.configuration=file:/<properties file> and this was added to the command line for both the managed and admin servers. Problem is that the console app starts its own instance of log4j, and when it reads the configuration for the appenders it initializes or rolls over the files. At some point we have two JVMs accessing the same files, so some corruption is bound to happen.
    I'm not clear why the .xml file made a difference, but earlier we had been passing the log4j configuration as a jar file placed in the domain/lib folder, so perhaps the designer reverted to that (placed the log4j.xml file in a jar in lib, and not simply changed the -Dlog4j.configuration=file:/ option.

  • LMS3.2.1 - should my custom log rotation settings override log4j properties?

    For LMS 3.2.1 on Windows, I have configured log rotation settings for dcmaservice.log but the settings are ineffective, even after stop/start CW daemon manager.  Other posts on this forum state that dcmaservice.log rotation is managed by log4j but can also be configured in logrot.  Is this incorrect or have I encountered a bug in logrot?

    Gaganjeet,
    I'd like definitive answers to the following questions before continuing down this path.
    1) does log4j subsystem manage dcmaservice.log?
    2) if so, is there a log4j properties file for dcmaservice which can be edited to change log file size and number of versions to keep (eg. see the forum entry https://supportforums.cisco.com/message/664225#664225 re license.log)?
    3) can Common Services user-configurable log rotation override the parameters for logs managed by log4j subsystem?
    Thanks.

Maybe you are looking for

  • Camera causes Iphone to crash in colder weather

    Now this is an odd one. My Iphone 3GS since latest firmware update has a weird "feature" When outside for a while and I try to take a photo , the whole thing just crashes and restarts for minutes. Thought at first it was happening only in really cold

  • Corrupt wav files in Adobe but play fine in other apps

    I have some old projects that have been backed up several times.  The problem is some of the sound files appear corrupt when I load them into Adobe Audition.  The sound plays all distorted with VERY LOUD clicks/pops in it.  However, I can play the sa

  • Wrt54g login and then blank

    this just kinda happens randomly and then stops again but its really annoying when it happens. I need to change some setting and when I log in with my username and password I get a totally blank page, no error no nothing. heres a picture of what I ge

  • Address of plant

    I have crated a Plant and now i want to change the address.it is allowing me to change name1&name2 ot the plant. but not allowing me to change the detailed address of the plant.i have tried in OX10 but not successful.please any one help me Edited by:

  • Execute Script from URL

    I think there's probably a security implication, but is it possible to execute a script from a URL - ideally in Safari? I want to be able to store a local file reference ( file://... ) as a bookmark and have this call a script.