How to check Run time error logs of proxy

Not applicable

we are team working on apigee on-premise environment. we are created the proxies and able to trace the proxies. But we are unable to see run time logs. Suppose we were created a java callout policy written code. but we can't see the run time errors for that code.

So how will i check the run time error logs. I want detailed logging mechanism. what should i do for logging mechanism.

0 4 2,340
4 REPLIES 4

rtalanki
Participant II

@suresh .. What version of OPDK are you using?

@suresh

The runtime errors are captured in system.log of each component (Router, Message Processor, Management Server etc.). These files can be found under $INSTALL_ROOT/apigee4/share/var/log/apigee/logs

The default logging level is set to -INFO. If more information is needed, then the logging level can be increased to -DEBUG in a configuration file called logback.xml which is there in the conf dir.

(Search for -INFO and replace with -DEBUG in the logback.xml and then restart the component to affect the change)

tail the system logs for more information.

remeeshnair
Participant IV

To Add what @Venkataraghavan mentioned, logback.xml update requires a componens restart, if you don't want to have component restart, you can also use below commands to enable the Apigee session logs for which will update system.log logging level and also create a session level log.

To Enable DEBUG level and session logging:

Run this command on the box where apigee component is running.

curl -v -X POST "http://localhost:<<portnumber>>/v1/logsessions?session=test"

portnumber will be your MP or Router listening port. Normally it will be kept as 8081 for router and 8082 for MP, but it may differ based on your installation config.

To Remove the DEBUG level and session logging:

curl -v -X DELETE "http://localhost:<<portnumber>>/v1/logsessions/test"

NOTE : From experience what i have seen is , there was a bug on this command, sometimes the the "DELETE" command was not getting honored by apigee edge component. So after you run DELETE command make sure your system.log is back in INFO mode by checking last few lines of the log. Probably apigee team can confirm if this is fixed or not.

Sessions logs:

This can be found under directory /<<install direcotry>>/apigee4/var/log/apigee/message-processor/logs/sessions if you are running for MP. Replace "message-processor" with "router" if it is for router. You will see a UUID named .log file there.

Remember keeping logs in DEBUG mode especially in production is not a good practice, because it can introduce a small amount delay in response time and also it increases the IO operations.

Regards,

Remeesh

Be aware of a couple of things:

1) this mode generates a TON of data... as much data as I generate in 3 months in normal logging mode in about 5 minutes (or less..)

2) this mode is only useful if it is enabled - so you will not be able to get at details of errors that have already happened.

To get the missing data from (2) above you need to go and manually add message logging policies to your proxy - and account for all possible exit scenarios in the code.