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

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.

  • 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

  • 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

  • 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 ?

  • 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

  • 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

  • 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

  • Log4j: XML configuration file problem

    Hello,
    I set up some logging in my existing application with log4j and an xml configuration file. Now I made some changes to my package structure, and some problems occured. So I thougt of setting the logging level of one of my loggers (named myapp.iointerface.DBAccess in the config file). So the only change I did was adding a <param name="Level" value="TRACE"/> to my logger. Now, log4j complains when it reads the configruation file:
    log4j:WARN Continuable parsing error 36 and column 11
    log4j:WARN The content of element type "logger" must match "(level?,appender-ref*)".My config file:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration debug="false" xmlns:log4j="http://jakarta.apache.org/log4j/">
         <appender name="RootConsole" class="org.apache.log4j.ConsoleAppender">
              <param name="Threshold" value="DEBUG"/>
              <param name="Target" value="System.err"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d{dd MM yyyy HH:mm:ss} %p %C %nIn Zeile Nummer: %L %m %n%n"/>
              </layout>
         </appender>
         <appender name="LoginInfo" class="org.apache.log4j.FileAppender">
              <param name="Threshold" value="TRACE"/>
              <param name="File" value="${user.dir}/login_info.log"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d{dd MM yyyy HH:mm:ss} %p %C %nIn Zeile Nummer: %L %m %n%n"/>
              </layout>
         </appender>
         <appender name="DBConnectionInfo" class="org.apache.log4j.FileAppender">
              <param name="Threshold" value="TRACE"/>
              <param name="File" value="${user.dir}/db_connection.log"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d{dd MM yyyy HH:mm:ss} %p %C %n%m %n%n"/>
              </layout>
         </appender>
         <logger name="myapp.windows.MainFrameController" additivity="false">
              <appender-ref ref="LoginInfo"/>
         </logger>
         <logger name="myapp.iointerface.DBAccess" additivity="false">
              <param name="Level" value="TRACE"/>
              <appender-ref ref="DBConnectionInfo"/>
         </logger>
         <root>
              <param name="Level" value="DEBUG"/>
              <appender-ref ref="RootConsole"/>
         </root>
    </log4j:configuration>Does anybody know what's wrong with that? I don't understand and found nothing googling it netiher. The strange thing is, that logging messages with level TRACE are recorded in the destination file, but the level id DEBUG.
    Thx,
    Julien

    If you look at the error, the parser expects level and not Level
    So :
    <param name="Level" value="TRACE"/>should be :
    <param name="level" value="TRACE"/>Same goes for :
    <param name="Level" value="DEBUG"/>That will solve the problem (even though it is not a critical error)!

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Not sure how to configure Weblogic with log4j.xml

    I tried something VERY similar to this. I wasn't sure where to put this code below. I figured in a Servlet environment, it should probably go in a Listener. I found an existing class inside of Spring that does exactly that: org.springframework.web.util.Log4jConfigListener
    I put my log4j configuration file into an entry in the classpath and configured web.xml as follows:
    <!-- Spring log4j parameters -->
            <context-param>
                <param-name>log4jConfigLocation</param-name>
                <param-value>classpath:gov/pa/dep/formu/resources/log4j.properties</param-value>
            </context-param>
            <context-param>
                <param-name>log4jRefreshInterval</param-name>
                <param-value>30000</param-value>
            </context-param>
            <!-- Spring Log4j config listener -->
         <listener>
              <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
         </listener>The server admin placed the actual log4j.properties file into an AppFileOverrides folder instead of under WEB-INF\classes. I don't know if this caused the problem or not. Since I also was using the DailyRollingFileAppender and running into problems LOSING my log entries each day because he file didn't get renamed, I followed Metalink BUG# 8459807, and used the datedFileAppender available at http://minaret.biz/tips/datedFileAppender.html.
    When the application started, the server log showed that log4j was being configured but none of my logging statements were going into the logs. It wasn't until the server admin placed a copy of log4j.properties (a different log4j.properties with a rolling file appender) that the log statements started going into the file that was configured based on web.xml.
    Surely, things can't be this difficult with log4j, and commons logging under WebLogic.
    All I want is APPLICATION LEVEL LOGS that are specific to the day.
    Can someone else elaborate on how they got this working?
    thanks a bunch,
    Eric

    Hi,
    The configuration wizard (config.sh) lets you create a WebLogic Domain, however and depending on others "Oracle Middleware" products installed on the same "Oracle Home" (directory where weblogic has been installed) the configuration wizard allows you create the new weblogic domain to support the others middleware products such as WebCenter.
    When I say support It means that Configuration Wizard allows you to create the weblogic resources like JDBC connections, JMS services, and deploys all applications that integrates another product such as WebCenter.
    I suggest create your domain with support for WebCenter and then from Admin Console create the JDBC resource to connect to other database such as JD Edwards database.
    I hope this help.

  • Configuring log4j 1.1.2 with WL6.0

    I'm sure many of you have configured Log4J version 1.1.2 with weblogic 6.0? following is the problem I have configuring it, any help is appreciatedI am setting the system property log4j.configuration during weblogic start up using "-Dlog4j.configuration=log4j.properties". I have the file in WEB-INF/classes directory of my web-application as documented in log4j manual, but I still get the well documentedlog4j: No appenders could be found for category (some.category.name).log4j: Please initialize the log4j system properlycould someone please point me in the right direction??thanx in advance

    We've had to do the same for log4j and now for resource bundles. My
    understanding was that anything under web-inf/classes was part of the
    classpath for the webapp. WLS 6.0sp1 does provide isolation between webapps,
    but it seems that things that are found by searching the classpath
    (properties/resources) don't get found. This is a big issue for us because
    separate web apps may need their own version of log4j, resource bundles,
    etc. The example Daniel provided works for us, until we want a separate
    configuration for different web apps.
    I hope someone [BEA?] can clarify the behavior of classpath searching (not
    class loading) when using webapps. Maybe this should be in the Servlet
    thread, but I didn't see anything like this thread over there.
    "Daniel Hoppe" <[email protected]> wrote in message
    news:[email protected]..
    Hi Kiran,
    you could specify a complete file url like this one:
    -Dlog4j.configuration=file:/c:/dev/fbs2/repository/fbs_config/log_config
    .xml
    Cheers,
    Daniel
    -----Ursprüngliche Nachricht-----
    Von: Kiran [mailto:[email protected]]
    Bereitgestellt: Freitag, 8. Juni 2001 08:23
    Bereitgestellt in: environment
    Unterhaltung: Configuring log4j 1.1.2 with WL6.0
    Betreff: Configuring log4j 1.1.2 with WL6.0
    I'm sure many of you have configured Log4J version 1.1.2 with weblogic
    6.0? following is the problem I have configuring it, any help is
    appreciatedI am setting the system property log4j.configuration during
    weblogic start up using "-Dlog4j.configuration=log4j.properties". I
    have the file in WEB-INF/classes directory of my web-application as
    documented in log4j manual, but I still get the well documentedlog4j: No
    appenders could be found for category (some.category.name).log4j: Please
    initialize the log4j system properlycould someone please point me in the
    right direction??thanx in advance

  • How to switch off  log4j trace ...

    Hi,
    I have different behavior of log4j on windows and Solaris.
    Assume I cofigured to have log on a file.
    On window it is fine.
    On Solaris it is fine too. but in later case, there are some traces printed in the screen as:
    *** configurationOptionStr=null
    ** End of LogManager static initializer
    log4j:INFO Creating new logger .....
    How can I remove this kind of information on sonsole as it will confuse our users who have no idea about this?
    Thanks.
    Pengyou

    *** configurationOptionStr=null
    ** End of LogManager static initializer
    log4j:INFO Creating new logger .....I don't know where these come from. But I'd have to assume that if indeed you used the same version of log4j jar(s) on both platforms, and the same log4j configuration, you'd get the same results.

  • How to set filename into log4j.properties using LogFactory from apache

    I'm getting a java.lang.ClassCastException .. Please help. Thanks.
    package src;
    import java.io.IOException;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.apache.log4j.Category;
    import org.apache.log4j.rolling.RollingFileAppender;
    public class FileLock {
    private static Log log = LogFactory.getLog(FileLock.class);
         public static void main(String[] args) throws IOException {
              // TODO Auto-generated method stub
              String logFile="C:/TEST123.TXT";
              RollingFileAppender apd = (RollingFileAppender) ((Category) log).getAppender("FILELOG");
              apd.setFile(logFile);
              apd.activateOptions();
              log.debug ( "This is a test debug");
              log.trace ( "This is a test trace");
              log.fatal ( "This is a test fatal");
    Snapshot from my log4j.xml.
    <appender name="FILELOG" class="org.apache.log4j.RollingFileAppender">
    <param name="File" value="C:/a.log" />
    <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern"
    value="[%d{ISO8601}] %-5p %c %m %n" />
    </layout>
    <filter class="org.apache.log4j.varia.LevelRangeFilter">
    <param name="LevelMin" value="DEBUG"/>
    <param name="LevelMax" value="INFO"/>
    </filter>
    </appender>
    *************

    Thanks here's the list:
    log4j:INFO Using URL [file:/C:/TEST2/FileLocking/bin/log4j.xml] for automatic log4j configuration of repository named [default].
    [2006-08-10 10:52:08,421] DEBUG org.apache.log4j.joran.action.ConfigurationAction Ignoring debug attribute.
    [2006-08-10 10:52:08,437] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.FileAppender]
    [2006-08-10 10:52:08,453] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [FILELOG]
    [2006-08-10 10:52:08,453] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,453] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [File] to value [C:/a.log].
    [2006-08-10 10:52:08,484] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,531] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,531] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}] %-5p %c %m %n].
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [DEBUG].
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [INFO].
    [2006-08-10 10:52:08,593] DEBUG org.apache.log4j.FileAppender setFile called: C:/a.log, true
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.FileAppender setFile ended
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [FILELOG] from the object stack
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.ConsoleAppender]
    [2006-08-10 10:52:08,609] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [STDOUT]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [Target] to value [System.out].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}] %-5p %c %m %n].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [DEBUG].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [INFO].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [STDOUT] from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.ConsoleAppender]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [STDERR]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [Target] to value [System.err].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}] %-5p %c %m %n].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [WARN].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [FATAL].
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [STDERR] from the object stack
    [2006-08-10 10:52:08,625] DEBUG org.apache.log4j.joran.action.AppenderAction About to instantiate appender of type [org.apache.log4j.net.SMTPAppender]
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.AppenderAction Appender named as [EMAIL]
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.AppenderAction Pushing appender on to the object stack.
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [BufferSize] to value [512].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [SMTPHost] to value [exchange.medi.com].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [From] to value [[email protected]].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [To] to value [[email protected]].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [Subject] to value [[SMTPAppender] Application message].
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.LayoutAction About to instantiate layout of type [org.apache.log4j.PatternLayout]
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.LayoutAction Pushing layout on top of the object stack.
    [2006-08-10 10:52:08,734] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [ConversionPattern] to value [[%d{ISO8601}]%n%n%-5p%n%n%c%n%n%m%n%n].
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.LayoutAction Popping layout from the object stack
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.LayoutAction About to set the layout of the containing appender.
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMin] to value [ERROR].
    [2006-08-10 10:52:08,750] DEBUG org.apache.log4j.joran.action.ParamAction In ParamAction setting parameter [LevelMax] to value [FATAL].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderAction Popping appender named [EMAIL] from the object stack
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.RootLoggerAction Pushing root logger on stack
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.LevelAction Encapsulating logger name is [root], levelvalue is [all].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.LevelAction root level set to ALL
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [FILELOG] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [STDOUT] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [STDERR] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.AppenderRefAction Attaching appender named [EMAIL] to logger named [root].
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.action.RootLoggerAction Removing root logger from top of stack.
    [2006-08-10 10:52:08,812] DEBUG org.apache.log4j.joran.JoranConfigurator Finished parsing.
    java.lang.ClassCastException
         at src.FileLock.main(FileLock.java:19)
    Exception in thread "main"

Maybe you are looking for