This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 560
HowTo Trace Messages
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
ExchangeService exchangeService = new ExchangeService(...);
/* TODO: do initialising stuff here */
exchangeService.setTraceEnabled(true);
exchangeService.setTraceFlags(EnumSet.allOf(TraceFlags.class)); // can also be restricted
exchangeService.setTraceListener(new ITraceListener() {
public void trace(String traceType, String traceMessage) {
// do some logging-mechanism here
log("Type:" + traceType + " Message:" + traceMessage);
}
});
Copyright © 2015 Microsoft Corporation - Project is released under the terms of the MIT License
Website
Getting Started
FAQ
Misc
Project Team