Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1321] add logger request server serviceName/ip/port #1322

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

chengyouling
Copy link
Collaborator

No description provided.

@chengyouling chengyouling self-assigned this Jul 11, 2024
@@ -30,6 +30,8 @@ public class GovernanceProperties {

public static final int WEB_FILTER_SERVICE_AUTH_ORDER = -60000;

public static final int WEB_FILTER_REQUEST_SERVICE_LOGGER_ORDER = -35000;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WEB_FILTER_REQUEST_LOGGER_ORDER

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -56,6 +58,9 @@ public class GovernanceProperties {
public static final String WEBCLIENT_FAULT_INJECTION_ENABLED =
PREFIX + "." + "webclient.faultInjection.enabled";

public static final String WEBCLIENT_REQUEST_SERVICE_LOGGER_ENABLED =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WEBCLIENT_REQUEST_LOGGER_ENABLED

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -56,6 +58,9 @@ public class GovernanceProperties {
public static final String WEBCLIENT_FAULT_INJECTION_ENABLED =
PREFIX + "." + "webclient.faultInjection.enabled";

public static final String WEBCLIENT_REQUEST_SERVICE_LOGGER_ENABLED =
PREFIX + "." + "webclient.requestServiceLogger.enabled";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requestServiceLogger -> requestLogger

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


public static void logServiceInfo(InvocationContext context, Throwable e) {
if (context != null && context.getLocalContext(GovernanceConst.CONTEXT_CURRENT_INSTANCE) != null) {
if (context.getLocalContext(GovernanceConst.CONTEXT_CURRENT_INSTANCE) instanceof ServiceInstance) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONTEXT_CURRENT_INSTANCE 还可能是其他类型吗?

Copy link
Collaborator Author

@chengyouling chengyouling Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有,已去掉判断

}

private ClientResponse logServiceInfo(ClientResponse response, ClientRequest request) {
if (response.statusCode() != HttpStatusCode.valueOf(200)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

response.statusCode().value() != 200 or family.isSucceful

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@qigaoneng
Copy link

OK

@chengyouling chengyouling merged commit 7b8b79b into huaweicloud:master Aug 16, 2024
1 check passed
@chengyouling chengyouling deleted the master-log branch August 20, 2024 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants