[Apiman-user] policy error/failure writer cannot find logger

Balu S sbalu27 at gmail.com
Mon Aug 28 09:05:16 EDT 2017


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?
            logger.info("
         }
......

Could you please suggest how can I add IApimanLogger to my custom error or
failure writers ?

Best regards
Balu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20170828/300114a7/attachment.html 


More information about the Apiman-user mailing list