Reputation: 18171
Can someone tell me where and how I setup path
in Netbeans
? I would like to add a .properties file
I have log4j sample project that does't sees log4j.properties file:
log4j:WARN No appenders could be found for logger (log4j_lesson.log4jExample).
log4j:WARN Please initialize the log4j system properly.
Main class:
import org.apache.log4j.Logger;
import java.io.*;
import java.sql.SQLException;
import java.util.*;
public class log4jExample{
/* Get actual class name to be printed on */
static Logger log = Logger.getLogger(
log4jExample.class.getName());
public static void main(String[] args)
throws IOException,SQLException{
log.debug("Hello this is an debug message");
log.info("Hello this is an info message");
}
}
Upvotes: 0
Views: 60
Reputation: 1213
Add -Djava.library.path=/path/to/properties/file
to your 'VM Options' which you get to in Netbeans by right clicking on the project, selecting 'Properties' then 'Run'.
Alternatively add the properties file to the base directory of your project, log4j looks their automatically.
Upvotes: 1