CAM REST API Logging
Logging for the CAM REST API is handled through four web applications and the Windows event log, which by default records the most serious errors. You can adjust default CAM REST API log settings to add more detailed information to the log.
The following web applications log information related to the REST API:
- Authentication Service: Handles authentication requests.
- Gateway Service: Routes requests to other components and provides REST API Discovery Tool (Swagger) documentation.
- Data Service: Handles inventory data.
- Purchasing Service: Handles data managed by the Purchasing application.
Each application can generate logging information independently. By default, log files are stored in c:\Logs.
You can control logging by modifying the log4net.config file located in the installation directory for each component. Each configuration file contains commented-out sections that you can enable to write more detailed information to the logs.
Authentication Service Log
Successful authentication attempts show the authentication methods used to log the user into CAM and Cherwell Service Management if CSM authentication is enabled, along with the result of each attempt.
If CSM authentication is used, the log shows the unique ID of the Security Group that the logged-in user is assigned in CSM. Successful authentication attempts also show the user logged out of CSM. This eliminates the need for the CAM user to consume a CSM license for the duration of their CAM session.
Search for ERROR lines to help find the cause of unsuccessful authentication attempts.
The configuration file for this log is located here:
\%programfiles(x86%)\Cherwell Asset Management\CamRestApi\ApiAuthenticationService\log4net.config
Gateway Service Log
This log records calls that are made to the CAM REST API and the result of each call. ERROR and WARN level log entries indicate problems, such as requests that use an an expired or incorrect access token.
The configuration file for this log is located here:
\%programfiles(x86%)\Cherwell Asset Management\CamRestApi\ApiGateway\log4net.config
Data Service
Data retrieval errors are recorded as ERROR or WARN level logs. In normal operation, the log records successful retrieval of data, such as the following example:
INFO Cam.Api.DataService.V1.Controllers.ComputerController
[GetComputers/4446] - Fetched 1 Video Controllers for Computer 4434
The configuration file for this log is located here:
\%programfiles(x86%)\Cherwell Asset Management\CamRestApi\ApiDataService\log4net.config
Purchasing Service Log
Shows the detail of data returned to the client. Expect ERROR and WARN level logs to indicate problems getting data back from the database.
The configuration file for this log is located here:
Troubleshoot Log Problems
Some systems require higher privileges to write the logging to the default location. If a log is not generated, try these options:
- Write the file to another location where permissions may not be as strict.
- Grant IIS_IUSRS read/write permission to the folder location.
- Grant the Application Pools higher authority in IIS. For example, use Local System instead of Application Pool Identity.