message logging policy is attached in shared flow, I am unable to see the logs.

I have attached Message Logging policy in Shared flow and attached the Shared flow to api proxy using flow hook. We are working Apigee Private Cloud and using file based logging.

I am unable to see logs on the server. Is this a known behaviour or am I missing anything.

0 6 660
6 REPLIES 6

Hi Apoorva, where did you use the FlowHook?

Are you using it in a PostClientFlow?

As per the docs, only MessageLogging Policy can be used in PostClientFlow. If you are using Flowhook in PostClientFlow, then I guess it won't work.

Hi Siddharth, It am not using PostClientFlow. It is Pre-Proxy flow hook.

Can you show us your MessageLoggingPolicy, what data are you trying to log?

@Siddharth Barahalikar Can you create a flowhook for Postclient flow? I don't think you can. Flowhooks are available only for Proxy-Pre-Flow, Proxy-Post-Flow, Target-Pre-Flow and Target-Post-Flow

Yep, we cant(there is no option to) use Flowhooks in PostClientFlow.

I was thinking about SharedFlow, it can be used in PostClientFlow. But ideally, MessageLoggingPolicy in a SharedFlow shouldn't work either because only MessageLogging(ML) policies can be attached to this flow.

Maybe Apoorva is using response flow variables in ML policy and since she has attached it to Pre-Proxy FlowHook, she is not seeing any logs.

She should be adding the ML Policy in PostClientFlow as it executes after the response is sent to the requesting client, which ensures that all metrics are available for logging.

@Siddharth Barahalikar You cant include sharedflows in PostClientFlow. I have tried that, it gives a error and confirmed that its the expected behavior from an old post.

If ML is included in the Pre-Proxy-Flow hook, then logging would be synchronous, or you will need to use some other mechanism to do the logging asynchronously; perhaps js if you have a http service for the logging endpoint