Results 1 to 3 of 3
  1. #1
    nmvictor is offline Member
    Join Date
    Oct 2009
    Posts
    31
    Rep Power
    0

    Unhappy Weird error with FileHandler, java.util.logging.FileHandler

    I am trying to enable logging logging for my application but it cant start because of this error
    Java Code:
    Exception in thread "main" java.lang.IllegalArgumentException
    	at java.util.logging.FileHandler.<init>(Unknown Source)
    	at eAdmin.EstudentAdministration.initializeProperties(EstudentAdministration.java:311)
    	at eAdmin.EstudentAdministration.main(EstudentAdministration.java:269)
    The section of code with which i am trying to enable the logging is

    Java Code:
       */
        public static void main(String[] args) {
            if(args == null || args.length != 1) {
               showUsage();
               System.exit(1);
            }
            /*
             * SOME WEIRD ERROR HERE!!!!
             */
            Properties props = new Properties();
            try {
            InputStream inputStream = new FileInputStream(args[0]);
            props.load(inputStream);
            } catch(IOException ioe) {
                ioe.printStackTrace(System.err);
            }
             // Initialize the properties/configurations
            initializeProperties(props);
            BasicConfigurator.configure();
            EstudentAdministration eAdmin = new EstudentAdministration();
            eAdmin.show();
        }
    
     private static void initializeProperties(Properties _props) {
            try {
            logFile = _props.getProperty("LOG_FILE", DEFAULT_LOG_FILE);
            FileHandler logFileHandler = new FileHandler(logFile);
            eAdminLOG.addHandler(logFileHandler);
            } catch(IOException ioe) {
                ioe.printStackTrace(System.err);
            }
    
        }

  2. #2
    ziaf is offline Member
    Join Date
    Mar 2010
    Posts
    8
    Rep Power
    0

    Default

    Either u have empty entry in the property file or u have no entry in the property file and DEFAULT_LOG_FILE is empty

  3. #3
    nmvictor is offline Member
    Join Date
    Oct 2009
    Posts
    31
    Rep Power
    0

Similar Threads

  1. Jre upgrade Issue :java.util.zip.ZipException: error in opening zip file
    By selvakumar.velmurugesan in forum New To Java
    Replies: 0
    Last Post: 10-27-2009, 05:20 AM
  2. Java logging - log file location for FileHandler
    By kfir.wolfson@gmail.com in forum Advanced Java
    Replies: 2
    Last Post: 03-24-2009, 08:22 AM
  3. java.util.logging.StreamHandler memory leak?
    By toadaly in forum Advanced Java
    Replies: 1
    Last Post: 02-23-2009, 02:46 PM
  4. Weird Error?
    By sciguy77 in forum New To Java
    Replies: 4
    Last Post: 01-20-2009, 02:32 AM
  5. java.util.UnknownFormatConversionException error
    By rosh72851 in forum Advanced Java
    Replies: 7
    Last Post: 10-09-2008, 04:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •