You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sergey Prasolov edited this page Jan 18, 2023
·
1 revision
Sometimes you will be in need to debug the request/response send and recieved with ews-java-api. To do so, you can set a modifiable TraceListener and print or log the Trace Messages.
Remember to not put this in your production code
ExchangeServiceexchangeService = newExchangeService(...);
/* TODO: do initialising stuff here */exchangeService.setTraceEnabled(true);
exchangeService.setTraceFlags(EnumSet.allOf(TraceFlags.class)); // can also be restrictedexchangeService.setTraceListener(newITraceListener() {
publicvoidtrace(StringtraceType, StringtraceMessage) {
// do some logging-mechanism herelog("Type:" + traceType + " Message:" + traceMessage);
}
});