Reputation: 2818
I am calling a web service using the following code
public static ServResponse enGenderAndSentiment(String url, Tweet t) {
HttpClient httpClient = new DefaultHttpClient();
String responseBody = "";
ServResponse holder = null;
try {
# calling a web service here
} catch (Exception ex) {
logger.debug("Exception while calling api for : " + t.getId());
logger.debug(ex);
} finally {
httpClient.getConnectionManager().shutdown();
}
return holder;
}
An exception is thrown while executing the previous code and when I check the log file, I found the message Exception while calling ... but I the exception itself is not logged.
What could be the problem here? why the second logging statement is not printing anything in the log file?
Upvotes: 0
Views: 196
Reputation: 6299
Use logger.error(ex,ex);
instead of logger.debug(ex);
to log also the stacktrace (with optional cause exceptions)...
Upvotes: 1