File tree 3 files changed +10
-8
lines changed
polaris-common/polaris-logging/src/main
java/com/tencent/polaris/logging/log4j2
polaris-discovery/polaris-discovery-factory/src/test/java/com/tencent/polaris/discovery/test/core
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 30
30
import org .apache .logging .log4j .core .config .ConfigurationSource ;
31
31
import org .apache .logging .log4j .core .config .LoggerConfig ;
32
32
33
+ import static com .tencent .polaris .logging .LoggingConsts .LOGGING_UPDATE_EVENT ;
34
+
33
35
public class Log4j2PolarisLogging extends AbstractPolarisLogging {
34
36
35
37
private static final String LOG4J2_LOCATION = "classpath:polaris-log4j2.xml" ;
@@ -59,7 +61,7 @@ public void loadConfiguration() {
59
61
}
60
62
Map <String , LoggerConfig > loggers = configuration .getLoggers ();
61
63
for (String name : loggers .keySet ()) {
62
- if (name .startsWith (LOGGER_PREFIX )) {
64
+ if (name .startsWith (LOGGER_PREFIX ) || name . contains ( LOGGING_UPDATE_EVENT ) ) {
63
65
contextConfiguration .addLogger (name , loggers .get (name ));
64
66
}
65
67
}
Original file line number Diff line number Diff line change 38
38
additivity =" false" >
39
39
<AppenderRef ref =" POLARIS_LOG_FILE" />
40
40
</Logger >
41
- <Logger name =" polaris-update-event"
41
+ <Logger name =" polaris-update-event-async "
42
42
level =" ${sys:polaris-update-event.log.level:-info}"
43
43
additivity =" false" >
44
44
<AppenderRef ref =" POLARIS_UPDATE_EVENT_LOG_FILE" />
45
45
</Logger >
46
- <AsyncLogger name =" polaris-update-event-async"
47
- level =" ${sys:polaris-update-event.log.level:-info}"
48
- additivity =" false" >
49
- <AppenderRef ref =" POLARIS_UPDATE_EVENT_LOG_FILE" />
50
- </AsyncLogger >
46
+ <!-- <AsyncLogger name="polaris-update-event-async"-->
47
+ <!-- level="${sys:polaris-update-event.log.level:-info}"-->
48
+ <!-- additivity="false"> -- >
49
+ <!-- <AppenderRef ref="POLARIS_UPDATE_EVENT_LOG_FILE"/> -- >
50
+ <!-- </AsyncLogger> -- >
51
51
</Loggers >
52
52
</Configuration >
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ public void testGetNotExistsService() {
189
189
GetOneInstanceRequest request = new GetOneInstanceRequest ();
190
190
request .setNamespace (NAMESPACE_TEST );
191
191
request .setService (NOT_EXISTS_SERVICE );
192
- Thread .sleep (3000 );
192
+ Thread .sleep (13000 );
193
193
InstancesResponse oneInstance = consumerAPI .getOneInstance (request );
194
194
Assert .assertEquals (1 , oneInstance .getInstances ().length );
195
195
} catch (InterruptedException e ) {
You can’t perform that action at this time.
0 commit comments