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

[JBWS-3998] jbossws-cxf - usage of Exception.printStackTrace() instead of logging feature #7

Merged
merged 1 commit into from Jul 11, 2016

Conversation

iweiss
Copy link
Contributor

@iweiss iweiss commented Jun 23, 2016

@jimma
Copy link
Member

jimma commented Jun 27, 2016

Thanks for the patch, Ingo. For the log in UDPDestination and CXFHandlerResolverImpl , can you please i18n the log message ? For the tool class, the logger is not initialized for the tool class, and I think we should still use the printStacktrace.

@iweiss
Copy link
Contributor Author

iweiss commented Jun 27, 2016

Jim, what do you think of using CXF's LogUtils for the tool classes then? About the i18n messages. I haven't done that because it isn't used. Is the plan to i18n all error messages then?

@asoldano
Copy link
Member

As for i18n messages, the only thing we could do to improve the "user experience" is saying in the message that the exceptions are actually going to be ignored (the UDPDestination and CXFHandlerResolverImpl ones).
As for the tool classes, I believe that those should simply not touched at all. The tool already have a mechanism for setting the output stream and log4j is properly used if available; the printstacktrace calls there are basically a fallback mechanism and it does not make sence go through complex detection procedures (as in CXF LogUtils) in this case.

@iweiss
Copy link
Contributor Author

iweiss commented Jun 28, 2016

Regarding UDPDestination, there is no i18n facility already in place, so it needs to be introduced. But, then again, this is the only class in modules/addons/transports. Should this change be introduced in all modules?

@asoldano
Copy link
Member

Well, in that case the effort is likely not worth the gain, so let's avoid i18n in UDPDestination. And no, generally speaking we should have already internationalized the logs that needed to be, here the idea was only to try improving the message.

@iweiss
Copy link
Contributor Author

iweiss commented Jul 4, 2016

Is this more inline with what should be done?

@@ -328,7 +331,8 @@ private void processHandlerElement(Element el, @SuppressWarnings("rawtypes") Lis
.unmarshal(el, PortComponentHandlerType.class).getValue();
chain.addAll(buildHandlerChain(pt, classLoader));
} catch (JAXBException e) {
e.printStackTrace();
DEPLOYMENT_LOGGER.unableToProcessHandlerElement(el, e);
log.error(e);
Copy link
Member

@asoldano asoldano Jul 4, 2016

Choose a reason for hiding this comment

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

Isn't the whole cause exception logged at the line above? Do we really need 2 log invocations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's my mistake. Sorry about that.

@asoldano asoldano merged commit 0fbff10 into jbossws:master Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants