首先是在config.groovy 的文件里面
打开
import org.apache.log4j.DailyRollingFileAppender
import org.springframework.core.io.ClassPathResource
import org.springframework.core.io.support.PropertiesLoaderUtils
import org.springframework.core.io.Resource
def config;
try {
Resource res = new ClassPathResource("uts-config.properties");
config = new Properties();
config.load(new InputStreamReader(res.getInputStream(), "UTF-8"));
} catch (Exception e) {
e.printStackTrace()
FileInputStream file = new FileInputStream("grails-app/conf/uts-config.properties");
config = new Properties();
config.load(new InputStreamReader(file, "UTF-8"));
file.close();
}
def log4jLevel=config["log4j.level"];
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request f