Hello,
I have a custom error and failure writers that implements IPolicyErrorWriter and IPolicyFailureWriter respectively. But these implementation methods does not provide IPolicyContext object to access loggers. However this is possible from IDataPolicy.
So I have tried to inject the ApimanLogger like below, but it always yields null. I have include the neccesary jar as "provided" scope in pom.xml.
example:
public class MyPolicyErrorWriter implements IPolicyErrorWriter{
@Inject @ApimanLogger(MyPolicyErrorWriter.class)
IApimanLogger logger;
@Override
public void write(ApiRequest request, Throwable error,
IApiClientResponse response) {
// here logger is always null?
}
......
Could you please suggest how can I add IApimanLogger to my custom error or failure writers ?
Best regards
Balu