Skip to content

Commit

Permalink
1.10.11
Browse files Browse the repository at this point in the history
  • Loading branch information
noear committed Nov 6, 2022
1 parent 5879814 commit 2f0c645
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion __test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@

<dependency>
<groupId>org.noear</groupId>
<artifactId>logback-solon-plugin</artifactId>
<artifactId>solon.logging.impl</artifactId>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion __test/src/main/java/webapp/TestApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void main(String[] args) throws Exception {
}).onAppLoadEnd(e -> {
System.out.println("4.应用全加载完成了");
}).start(TestApp.class, args, x -> {
//LogUtil.globalSet(new LogUtilToSlf4j());
LogUtil.globalSet(new LogUtilToSlf4j());

x.enableSocketD(true);
x.enableWebSocket(true);
Expand Down
6 changes: 3 additions & 3 deletions __test/src/main/resources/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ solon.logging.appender:
pattern: "%d{yyyy-MM-dd HH:mm:ss} %-5level %magenta(${PID:-}) %white(---) %-20(%yellow([%20.20thread])) %-55(%cyan(%.32logger{30}:%L)) %msg%n"
file:
enable: false
test:
class: webapp.demox_log_breaker.TestAppender
level: TRACE
# test:
# class: webapp.demox_log_breaker.TestAppender
# level: TRACE

solon.logging.logger:
"org.apache":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public static void print(Class<?> type, NamiClient anno) {
buf.append(")");
}

LogUtil.global().warn("Nami: " + buf);
LogUtil.global().info("Nami: " + buf);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ public class LogUtilToSlf4j extends LogUtil {

@Override
public void trace(String content) {
log.trace("[Solon] " + content);
log.trace(content);
}

@Override
public void debug(String content) {
log.debug("[Solon] " + content);
log.debug(content);
}

@Override
public void info(String content) {
log.info("[Solon] " + content);
log.info(content);
}

@Override
public void warn(String content) {
log.warn("[Solon] " + content);
log.warn(content);
}

@Override
public void error(String content) {
log.error("[Solon] " + content);
log.error(content);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static synchronized void register(TracerFactory service) {
try {
Solon.context().wrapAndPut(Tracer.class, service.create());

LogUtil.global().warn("Cloud: TracerFactory registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: TracerFactory registered from the " + service.getClass().getTypeName());
} catch (RuntimeException e) {
throw e;
} catch (Throwable e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ public static void discoveryPush() {
for (Signal signal : Solon.app().signals()) {
Instance instance = Instance.localNew(signal);
CloudClient.discovery().register(Solon.cfg().appGroup(), instance);
LogUtil.global().warn("Cloud: Service registered " + instance.service() + "@" + instance.uri());
LogUtil.global().info("Cloud: Service registered " + instance.service() + "@" + instance.uri());
}
});

Solon.app().onEvent(Signal.class, signal -> {
Instance instance = Instance.localNew(signal);
CloudClient.discovery().register(Solon.cfg().appGroup(), instance);
LogUtil.global().warn("Cloud: Service registered " + instance.service() + "@" + instance.uri());
LogUtil.global().info("Cloud: Service registered " + instance.service() + "@" + instance.uri());
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ public static void register(CloudEvent anno, CloudEventHandler handler) {
*/
public static void register(CloudBreakerService service) {
breakerService = service;
LogUtil.global().warn("Cloud: CloudBreakerService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudBreakerService registered from the " + service.getClass().getTypeName());
}

/**
* 登记配置服务
*/
public static void register(CloudConfigService service) {
configService = service;
LogUtil.global().warn("Cloud: CloudConfigService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudConfigService registered from the " + service.getClass().getTypeName());
}

/**
* 登记注册与发现服务
*/
public static void register(CloudDiscoveryService service) {
discoveryService = service;
LogUtil.global().warn("Cloud: CloudDiscoveryService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudDiscoveryService registered from the " + service.getClass().getTypeName());
}

/**
Expand All @@ -132,9 +132,9 @@ public static void register(CloudDiscoveryService service) {
public static void register(CloudEventServicePlus service) {
eventServiceManager.register(service);
if (Utils.isEmpty(service.getChannel())) {
LogUtil.global().warn("Cloud: CloudEventService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudEventService registered from the " + service.getClass().getTypeName());
} else {
LogUtil.global().warn("Cloud: CloudEventService registered from the " + service.getClass().getTypeName() + " as &" + service.getChannel());
LogUtil.global().info("Cloud: CloudEventService registered from the " + service.getClass().getTypeName() + " as &" + service.getChannel());
}
}

Expand All @@ -143,39 +143,39 @@ public static void register(CloudEventServicePlus service) {
*/
public static void register(CloudLockService service) {
lockService = service;
LogUtil.global().warn("Cloud: CloudLockService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudLockService registered from the " + service.getClass().getTypeName());
}

/**
* 登记日志服务
*/
public static void register(CloudLogService service) {
logService = service;
LogUtil.global().warn("Cloud: CloudLogService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudLogService registered from the " + service.getClass().getTypeName());
}

/**
* 登记列表服务
*/
public static void register(CloudListService service) {
listService = service;
LogUtil.global().warn("Cloud: CloudListService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudListService registered from the " + service.getClass().getTypeName());
}

/**
* 登记文件服务
*/
public static void register(CloudFileService service) {
fileService = service;
LogUtil.global().warn("Cloud: CloudFileService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudFileService registered from the " + service.getClass().getTypeName());
}

/**
* 登记国际化服务
*/
public static void register(CloudI18nService service) {
i18nService = service;
LogUtil.global().warn("Cloud: CloudI18nService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudI18nService registered from the " + service.getClass().getTypeName());
}


Expand All @@ -184,23 +184,23 @@ public static void register(CloudI18nService service) {
*/
public static void register(CloudTraceService service) {
traceService = service;
LogUtil.global().warn("Cloud: CloudTraceService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudTraceService registered from the " + service.getClass().getTypeName());
}

/**
* 登记度量服务
*/
public static void register(CloudMetricService service) {
metricService = service;
LogUtil.global().warn("Cloud: CloudMetricService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudMetricService registered from the " + service.getClass().getTypeName());
}

/**
* 登记任务服务
*/
public static void register(CloudJobService service) {
jobServiceManager = new CloudJobServiceManagerImpl(service);
LogUtil.global().warn("Cloud: CloudJobService registered from the " + service.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudJobService registered from the " + service.getClass().getTypeName());
}

/**
Expand All @@ -209,7 +209,7 @@ public static void register(CloudJobService service) {
public static void register(CloudIdServiceFactory factory) {
idServiceFactory = factory;
idServiceDef = factory.create();
LogUtil.global().warn("Cloud: CloudIdServiceFactory registered from the " + factory.getClass().getTypeName());
LogUtil.global().info("Cloud: CloudIdServiceFactory registered from the " + factory.getClass().getTypeName());
}

protected static CloudBreakerService breakerService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void prestop() throws Throwable {
Instance instance = Instance.localNew(signal);

CloudClient.discovery().deregister(Solon.cfg().appGroup(), instance);
LogUtil.global().warn("Cloud: Service deregistered " + instance.service() + "@" + instance.uri());
LogUtil.global().info("Cloud: Service deregistered " + instance.service() + "@" + instance.uri());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ private static void readNativeReflectConfig() {
}

if (Solon.cfg().isDebugMode()) {
LogUtil.global().info("load reflect-config completed: " + resources.toString());
LogUtil.global().info("reflect-config: load completed: " + resources.toString());
}
} catch (Exception e) {
LogUtil.global().warn("read reflect-config error :" + e.getLocalizedMessage());
LogUtil.global().warn("reflect-config: read error :" + e.getLocalizedMessage());
EventBus.push(e);
}
}
Expand Down Expand Up @@ -96,10 +96,10 @@ private static void readNativeResourceConfig() {
}

if (Solon.cfg().isDebugMode()) {
LogUtil.global().info("load resource-config completed: " + resources.toString());
LogUtil.global().info("resource-config: load completed: " + resources.toString());
}
} catch (Exception e) {
LogUtil.global().warn("read resource-config.json error :" + e.getLocalizedMessage());
LogUtil.global().warn("resource-config: read error :" + e.getLocalizedMessage());
EventBus.push(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public boolean register(String name, String cron7x, String description, CloudJob

jobMap.put(name, jobHolder);
TagsMDC.tag0("CloudJob");
LogUtil.global().warn("CloudJob: Handler registered name:" + name + ", class:" + handler.getClass().getName());
LogUtil.global().info("CloudJob: Handler registered name:" + name + ", class:" + handler.getClass().getName());
TagsMDC.tag0("");
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public boolean register(String name, String cron7x, String description, CloudJob
XxlJobExecutor.registJobHandler(name, new IJobHandlerImpl(jobHolder));

TagsMDC.tag0("CloudJob");
LogUtil.global().warn("CloudJob: Handler registered name:" + name + ", class:" + handler.getClass().getName());
LogUtil.global().info("CloudJob: Handler registered name:" + name + ", class:" + handler.getClass().getName());
TagsMDC.tag0("");
return true;
}
Expand Down
12 changes: 6 additions & 6 deletions solon/src/main/java/org/noear/solon/Solon.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static SolonApp start(Class<?> source, NvMap argx, ConsumerEx<SolonApp> i
//绑定类加载器(即替换当前线程[即主线程]的类加载器)
JarClassLoader.bindingThread();

LogUtil.solonWarn("App: Start loading");
LogUtil.solonInfo("App: Start loading");

try {
//1.创建全局应用及配置
Expand Down Expand Up @@ -176,7 +176,7 @@ public static SolonApp start(Class<?> source, NvMap argx, ConsumerEx<SolonApp> i
}

//启动完成
LogUtil.global().warn("App: End loading elapsed=" + app.elapsedTimes() + "ms pid=" + pid);
LogUtil.global().info("App: End loading elapsed=" + app.elapsedTimes() + "ms pid=" + pid);

return app;
}
Expand Down Expand Up @@ -216,11 +216,11 @@ private static void stop0(boolean exit, int delay) {

String hint = "(1.prestop 2.delay 3.stop)";

LogUtil.global().warn("App: Security to stop: begin..." + hint);
LogUtil.global().info("App: Security to stop: begin..." + hint);

//1.预停止
Solon.cfg().plugs().forEach(p -> p.prestop());
LogUtil.global().warn("App: Security to stop: 1 completed " + hint);
LogUtil.global().info("App: Security to stop: 1 completed " + hint);


//2.延时标停
Expand All @@ -239,11 +239,11 @@ private static void stop0(boolean exit, int delay) {
sleep0(delay2);
}

LogUtil.global().warn("App: Security to stop: 2 completed " + hint);
LogUtil.global().info("App: Security to stop: 2 completed " + hint);

//3.停止
Solon.cfg().plugs().forEach(p -> p.stop());
LogUtil.global().warn("App: Security to stop: 3 completed " + hint);
LogUtil.global().info("App: Security to stop: 3 completed " + hint);
} else {
//1.预停止
Solon.cfg().plugs().forEach(p -> p.prestop());
Expand Down
6 changes: 3 additions & 3 deletions solon/src/main/java/org/noear/solon/SolonApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected void initAwait() {
try {
while (true) {
if (Utils.ping(addr)) {
LogUtil.global().warn("App: Start ping succeed: " + addr);
LogUtil.global().info("App: Start ping succeed: " + addr);
Thread.sleep(1000); //成功也再等1s
break;
} else {
Expand Down Expand Up @@ -119,7 +119,7 @@ protected void run() throws Throwable{
//event::1.0.x推送Plugin init end事件
EventBus.push(PluginInitEndEvent.instance);

LogUtil.global().warn("App: Plugin startup");
LogUtil.global().info("App: Plugin startup");

//1.1.尝试启动插件(顺序不能乱) //不能用forEach,以免当中有插进来
for (int i = 0, len = plugs.size(); i < len; i++) {
Expand All @@ -130,7 +130,7 @@ protected void run() throws Throwable{
EventBus.push(PluginLoadEndEvent.instance);


LogUtil.global().warn("App: Bean start scanning");
LogUtil.global().info("App: Bean start scanning");

//2.1.通过注解导入bean(一般是些配置器)
importTry();
Expand Down
4 changes: 2 additions & 2 deletions solon/src/main/java/org/noear/solon/core/ExtendLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private void loadFileDo(List<ClassLoader> loaders, File file, Predicate<String>
if (path.endsWith(".properties")) {
Solon.cfg().loadAdd(file.toURI().toURL());

LogUtil.global().warn("loaded: " + path);
LogUtil.global().info("loaded: " + path);
return;
}

Expand All @@ -191,7 +191,7 @@ private void loadFileDo(List<ClassLoader> loaders, File file, Predicate<String>

Solon.cfg().loadAdd(file.toURI().toURL());

LogUtil.global().warn("loaded: " + path);
LogUtil.global().info("loaded: " + path);
return;
}
} catch (Throwable ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static void mapping(String suffix, String clzName) {

Render render = _lib.get(clzName);
if (render == null) {
LogUtil.global().warn("solon: " + clzName + " not exists!");
LogUtil.global().warn("Render: " + clzName + " not exists!");
return;
//throw new IllegalStateException(classSimpleName + " not exists!");
}
Expand Down

0 comments on commit 2f0c645

Please sign in to comment.