Transferring Apinizer System Logs as Syslog
Go to Administration > Connection Management > Syslog page and create a Syslog connection definition. For detailed information, please follow the link.
Transferring Application Logs as Syslog
Go to Administration > System Settings > General Settings and select Syslog Connector for application logs.
Choose the formerly created Syslog Connection definition.
After selecting the syslog connection for application logs, the application log data structure will be as follows.
- id: The unique identifier of the log record.
- date: The date and time the log was created.
- level: The importance level of the log (e.g., “INFO,” “WARN,” “ERROR,” “DEBUG”).
- message: The main message of the log, the text describing the event.
stackTrace: In error situations, a detailed stack trace showing the code path where the error occurred. It is usually very long and critical for troubleshooting.
hostName: The name of the machine where the Apinizer component that generated the log is running.
- enumApplicationLog: Indicates which Apinizer module the log came from (e.g., “MANAGER,” “GATEWAY”).
Example of an error message appearing in syslog:
2025-06-11T08:52:02.824Z apinizer_demo Apinizer_demo {"id":"684943b280f5de2a3c29d28b","date":"2025-06-11T08:52:02.810Z","level":"ERROR","message":"Connector response status code is 429","stackTrace":"java.lang.Exception: Connector response status code is 429\n\tat com.apinizer.common.executable.connector.webhook.ConnectorWebhookSend.sendWithFailover(ConnectorWebhookSend.java:185)\n\tat com.apinizer.common.executable.connector.webhook.ConnectorWebhookSend.executeAuditLog(ConnectorWebhookSend.java:119)\n\tat com.apinizer.manager.aop.auditing.AuditingAspectDatabaseOperationsService.saveAuditLog(AuditingAspectDatabaseOperationsService.java:104)\n... ...\n\tat java.lang.Thread.run(Thread.java:750)\n","hostName":"manager-58b4d4784d-sm47j","enumApplicationLog":"MANAGER"}
Transferring Token Logs as Syslog
Go to Administration > System Settings > General Settings and select Syslog Connector for token logs.
Choose the formerly created Syslog Connection definition.
After selecting the syslog connector for token logs, the token log message structure will be as follows.
- id: The unique identifier of the log record.
- timestamp: The timestamp when the token event occurred.
- apinizerCorrelationId: The unique correlation ID used to track all operations related to this token request in Apinizer.
- environmentId: The unique ID of the environment where the request was made.
- projectId: The unique ID of the project to which the request belongs.
- applicationName: The name of the application associated with the request (e.g., “Swagger Petstore Documentation”).
- apiProxyId: The unique ID of the API Proxy associated with the token request.
- apiProxyName: The name of the associated API Proxy.
httpRequestRemoteAddress: The IP address of the client making the token request.
- httpRequestHttpMethod: The HTTP method of the token request (usually “POST”).
httpRequestContentType: The content type of the request (e.g., “application/x-www-form-urlencoded”).
- usernameOrKey: The username or client key of the user requesting the token.
- timeTotal: The total duration of the token operation (ms).
statusCode: The HTTP status code of the token request (e.g., 200 Success).
- resultType: The result of the token operation (e.g., “SUCCESS”, “ERROR”).
- audience: The target audience or resource for which the token is valid.
clientInfo: Additional information about the client requesting the token (typically similar to usernameOrKey).
issuedAt: The timestamp when the token was issued.
- refreshTokenAllowed: Whether a refresh token is allowed for this operation (boolean).
- refreshTokenIssuedAt: The timestamp when the refresh token was issued.
refreshCount: The number of times the refresh token has been used.
Example of an token log message appearing in syslog:
2025-06-11T08:49:15.970Z apinizer_demo Apinizer_demo {"id":"6849430bfec3ea5f01ed3989","timestamp":"2025-06-11T08:49:15.229Z","apinizerCorrelationId":"dccababd-16e3-415e-b801-9f6a52b6a28c","environmentId":"63ca7ed05c8e155862d99e88","projectId":"68493b6e80f5de2a3c29c5ee","applicationName":"Swagger Petstore Documentation","apiProxyId":"68493bb680f5de2a3c29c609","apiProxyName":"Swagger Petstore Documentation","httpRequestRemoteAddress":"10.244.0.1","httpRequestHttpMethod":"POST","httpRequestContentType":"application/x-www-form-urlencoded","usernameOrKey":"documentation","timeTotal":19,"statusCode":200,"resultType":"SUCCESS","audience":"#GW#90c33df5f81e-4717-95f8-1ea76228a7d5","clientInfo":"documentation","issuedAt":"2025-06-11T08:49:15.220Z","refreshTokenAllowed":false,"refreshTokenIssuedAt":"2025-06-11T08:49:15.220Z","refreshCount":0}
Transferring Audit Logs as Syslog
Go to Administration > System Settings > General Settings and select Syslog Connector for application logs.
Choose the formerly created Syslog Connection definition.
After selecting Syslog Connector for audit logs, the audit log message structure will be as follows.
- id: The unique ID of the audit event.
- principal: The name of the user who performed the operation (e.g., “admin”).
- auditEventDate: The date and time when the audit event occurred.
- state: The type of operation performed (e.g., “CREATED,” “UPDATED,” “DELETED”).
- objectId: The unique identifier of the object (API, Policy, etc.) affected by the operation.
- objectName: The name of the object affected by the operation (e.g., “Swagger Petstore Documentation”).
- referenceObjectJson: The full JSON representation of the object after the operation. This field fully reflects the new state of the object and can often be very long.
- projectId: The unique identifier of the project to which the relevant object belongs.
- className: The class/type name of the object affected by the operation within Apinizer (e.g., “ApiProxy”).
Example of an audit log message appearing in syslog:
2025-06-11T08:26:11.650Z apinizer_demo Apinizer_de2025-06-11T08:26:11.650Z apinizer_demo Apinizer_demo {"id":"68493da280f5de2a3c29c975","principal":"admin","auditEventDate":"2025-06-11T08:26:10.710Z","state":"UPDATED","objectId":"68493bb680f5de2a3c29c609","objectName":"Swagger Petstore Documentation","referenceObjectJson":"{ \"id\": \"68493bb680f5de2a3c29c609\", \"name\": \"Swagger Petstore Documentation\", \"type\": \"REST\", ... <SOME_DETAILS> ... }","projectId":"68493b6e80f5de2a3c29c5ee","className":"ApiProxy"}