// first you need to configure the log4j
// the following step should be done only once for the whole application
String log4jPropertyFile = "log4j.properties";
PropertyConfigurator.configure(log4jPropertyFile);
// get the logger
Logger logger = Logger.getLogger("logger-name");
浙公网安备 33010602011771号