How do I enable logging for RESTful Web Services in Spectrum?
Looking at the definition of REST Architecture, it is a software architectural style that promotes standardized behaviors between interacting elements, or clients and servers. Conforming to the REST constraints is referred to as being RESTful.
The REST architecture is a lightweight HTTP/HTTPS-based approach for SOAPless Web Services using create (POST), read (GET), update (PUT), and delete (DELETE) operations or verbs.
RESTful architecture and applications are stateless, which means that no client context information is stored between requests.
Each request contains all the information necessary to service the request.
The CA Spectrum Web Services API supports the REST architecture but is also constrained by its stateless limitation.
CA Spectrum and REST architecture.
The localhost_access_log is not specific to REST calls so will contain a record for each REST call but does not contain much useful information.
When you run a web server, one of the output files normally generated is an access log, which generates one line of information for each request processed by the server, in a standard format.
It will log REST calls as it does all requests and is standard to the web server, in this case, tomcat.
What we can in Spectrum is is enable REST debug "RESTful Web Services" in OC Administration web server debug page.
e.g. I enabled it and posted an event as follows
here is the information that provides in the tomcat log.
Mar 29, 2019 04:56:26.718 (http-bio-80-exec-22) (RESTFULWEBSERVICES) - (DEBUG) - processing createEventByXML
Mar 29, 2019 04:56:26.721 (http-bio-80-exec-22) (RESTFULWEBSERVICES) - (DEBUG) - number of events to create: 1
Mar 29, 2019 04:56:26.728 (http-bio-80-exec-22) (RESTFULWEBSERVICES) - (DEBUG) - creating event of type 65538
number of target models: 1
number of varbinds: 2
Mar 29, 2019 04:56:26.732 (http-bio-80-exec-22) (RESTFULWEBSERVICES) - (DEBUG) - Event creation succeeded for target 0x4048e5x