Results 1 to 2 of 2
  1. #1
    nseaeast is offline Member
    Join Date
    Nov 2014
    Posts
    1
    Rep Power
    0

    Default Log4j configuration

    hi all,

    i have two applications running in Glassfish 2, both are using log4j and they have separated log.propeties. The problem is all the log in App2 always store in App1's log file.

    Here is how i init to load log.properties file.

    try {
    Properties p = new Properties();
    p.load(new FileInputStream("C:\log.properties1"));
    org.apache.log4j.PropertyConfigurator.configure(p) ;
    } catch(Exception e) {
    e.printStackTrace();
    }

    What does PropertyConfigurator do?

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    5,114
    Rep Power
    12

    Default Re: Log4j configuration

    Quote Originally Posted by nseaeast View Post
    What does PropertyConfigurator do?
    That is not what you want to ask as it is answered by the javadocs:

    PropertyConfigurator (Apache Log4j 1.2.17 API)

    What you really want to ask is: how do I get logging to go to separate log files. To be able to answer that you'd have to post the property files for both applications first.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2013, 01:04 PM
  2. Replies: 1
    Last Post: 09-20-2010, 08:32 AM
  3. JVM configuration, -xmx over 4 gb
    By tolja in forum Advanced Java
    Replies: 3
    Last Post: 06-30-2010, 12:09 PM
  4. Replies: 0
    Last Post: 03-16-2009, 01:41 PM
  5. Replies: 1
    Last Post: 02-19-2009, 05:02 PM

Posting Permissions

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