1、日志配置

master
wangbing 5 years ago
parent aa7fd9af4c
commit 73edc94e0e

@ -653,7 +653,7 @@ public class SpringBootCallable implements Callable {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "application-dev.properties"), option + "/resources/application-dev.ftl", ctx);
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "application-prod.properties"), option + "/resources/application-prod.ftl", ctx);
Tool.outputResource(option + "/resources/banner.txt", new File(root.getAbsolutePath(), "banner.txt"));
Tool.outputResource(option + "/resources/logback-config.xml", new File(root.getAbsolutePath(), "logback-config.xml"));
Tool.outputResource(option + "/resources/logback-spring.xml", new File(root.getAbsolutePath(), "logback-spring.xml"));
if (DataBase.ORACLE == dataBase) {
File lib = new File(root.getAbsolutePath(), "lib");
@ -704,7 +704,7 @@ public class SpringBootCallable implements Callable {
ctx.put("dBmapper", dBmapper);
ctx.put("date", new Date());
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "application.properties"), option + "/test/application.properties", ctx);
Tool.outputResource(option + "/test/logback-config.xml", new File(root.getAbsolutePath(), "logback-config.xml"));
Tool.outputResource(option + "/test/logback-spring.xml", new File(root.getAbsolutePath(), "logback-spring.xml"));
}
/**

@ -169,7 +169,8 @@ public class GlobalController implements ErrorController {
// 尝试执行Screen执行器(服务器渲染),并返回视图模板
try {
Screen screenExec = LocalData.getApplicationContext().getBean(ActionConfig.SCREEN_PREFIX + action, Screen.class);
String beanClassName = (ActionConfig.SCREEN_PREFIX + action).toLowerCase();
Screen screenExec = LocalData.getApplicationContext().getBean(beanClassName, Screen.class);
screenExec.exec(model, request, response);
if (response.getStatus() != HttpServletResponse.SC_OK) {
@ -254,7 +255,8 @@ public class GlobalController implements ErrorController {
BaseResponse baseResponse = null;
try {
Object ajax = LocalData.getApplicationContext().getBean(ActionConfig.AJAX_PREFIX + module + "/" + target);
String beanClassName = (ActionConfig.AJAX_PREFIX + module + "/" + target).toLowerCase();
Object ajax = LocalData.getApplicationContext().getBean(beanClassName);
Class ajaxClass = ajax.getClass();
Method methodC = ajaxClass.getMethod(method, String.class);

@ -69,10 +69,7 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor {
@Override
public String generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry beanDefinitionRegistry) {
String beanClassName = beanDefinition.getBeanClassName();
String beamName = beanClassName.replaceAll(basePackage + ".", SCREEN_PREFIX).replaceAll("\\.","/");
char[] chars = beamName.toCharArray();
if (chars[8] >= 65 && chars[8] <= 90) chars[8] += 32;
beamName = String.valueOf(chars);
String beamName = beanClassName.replaceAll(basePackage + ".", SCREEN_PREFIX).replaceAll("\\.","/").toLowerCase();
LogUtil.i("registry screen " + beamName);
return beamName;
}
@ -95,7 +92,7 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor {
@Override
public String generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry beanDefinitionRegistry) {
String beanClassName = beanDefinition.getBeanClassName();
String beamName = beanClassName.replaceAll(basePackage + ".", CONTROL_PREFIX).replaceAll("\\.","/");
String beamName = beanClassName.replaceAll(basePackage + ".", CONTROL_PREFIX).replaceAll("\\.","/").toLowerCase();
LogUtil.i("registry control " + beamName);
return beamName;
}
@ -118,7 +115,7 @@ public class ActionConfig implements BeanDefinitionRegistryPostProcessor {
if (beanClassName != null && beanClassName.endsWith("Ajax")) {
beanClassName = beanClassName.substring(0, beanClassName.length() - 4);
}
String beamName = beanClassName.replaceAll(basePackage + ".", AJAX_PREFIX).replaceAll("\\.","/");
String beamName = beanClassName.replaceAll(basePackage + ".", AJAX_PREFIX).replaceAll("\\.","/").toLowerCase();
LogUtil.i("registry ajax " + beamName);
return beamName;
}

@ -100,7 +100,8 @@ public class FreeMarkerConfig {
// 查找是否存在对应控制面板执行器
Control controlExec = null;
try {
controlExec = LocalData.getApplicationContext().getBean(CONTROL_PREFIX + control, Control.class);
String beanClassName = (CONTROL_PREFIX + control).toLowerCase();
controlExec = LocalData.getApplicationContext().getBean(beanClassName, Control.class);
HttpServletRequest request = LocalData.getRequest();
HttpServletResponse response = LocalData.getResponse();

@ -17,7 +17,6 @@ server.tomcat.uri-encoding=UTF-8
# 日志配置
logging.path=D://
logging.levels=DEBUG
logging.config=classpath:logback-config.xml
<#if dataBase == 'ORACLE'>
# oracle
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver

@ -17,7 +17,6 @@ server.tomcat.uri-encoding=UTF-8
# 日志配置
logging.path=/root/
logging.levels=INFO
logging.config=classpath:logback-config.xml
<#if dataBase == 'ORACLE'>
# oracle
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver

Loading…
Cancel
Save

Powered by TurnKey Linux.