Troubleshooting Log Endpoint

 

The Troubleshooting Log endpoint can be used to fetch and update the troubleshooting log configuration.

Note that configuration updated via Troubleshooting Log Endpoint is not persisted and will be restored to default after the Smile CDR restart.
A logger can only be targeted if it is one of the pre-defined troubleshooting loggers (see Troubleshooting Logs) or another Smile CDR or HAPI FHIR logger. In addition, loggers outside the pre-defined troubleshooting set cannot be set to TRACE or ALL, and security-sensitive loggers (such as authentication and authorization providers, whose classes can log credentials or tokens) cannot be set finer than INFO.

Fetch Troubleshooting Log Configuration

 
This method requires the VIEW_MODULE_CONFIG permission.

This method will return a list of configured troubleshooting logs. This list will contain pre-defined troubleshooting logs (see Troubleshooting Logs) as well as any custom troubleshooting log configuration.


To invoke:

GET http://localhost:9000/troubleshooting-log/configuration

The server will produce a response resembling the following:

[
	{
		"loggerName": "ca.cdr.log.hl7v2_troubleshooting",
		"loggerLevel": "OFF"
	},
	{
		"loggerName": "ca.cdr.log.http_troubleshooting",
		"loggerLevel": "DEBUG"
	}
]

For brevity, only 2 logger entries are shown, but a real response might contain many more.

Note the following details:

  • "loggerName": "ca.cdr.log.hl7v2_troubleshooting" – name of the logger; it can be one of the pre-defined troubleshooting logger's names, or another Smile CDR or HAPI FHIR logger, see Troubleshooting Logs for possible values.
  • "loggerLevel" : "DEBUG" – level of the logging; possible values: OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL.

Update Troubleshooting Logger Level

 
This method requires the MANAGE_TROUBLESHOOTING_LOGGING permission.

This method will update the logging level of the provided logger (a pre-defined troubleshooting logger, or another Smile CDR or HAPI FHIR logger).


To invoke (substitute a logger name into the path below):

PUT or POST http://localhost:9000/troubleshooting-log/configuration/{logger_name}?loggerLevel=DEBUG

Note the following path element:

  • logger_name – The name of the logger; it could be one of the pre-defined troubleshooting log names, or another Smile CDR or HAPI FHIR logger, see Troubleshooting Logs for possible values.

Required URL parameter:

  • loggerLevel=[string] – The level of the logging; possible values: OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL. Note that TRACE and ALL are only permitted for the pre-defined troubleshooting loggers, and security-sensitive loggers (such as authentication and authorization providers) cannot be set finer than INFO.

Response:
Upon successful update, this method will return a 200 "ok" status with the contents of the updated troubleshooting log as the response body.

{
	"loggerName": "ca.cdr.log.hl7v2_troubleshooting",
	"loggerLevel": "DEBUG"
}

Update Troubleshooting Log Configuration

 
This method requires the MANAGE_TROUBLESHOOTING_LOGGING permission.

This method updates the troubleshooting log configuration according to the provided request.


POST http://localhost:9000/troubleshooting-log/configuration
Content-Type: application/json

[
   {
      "loggerName":"ca.uhn.fhir.log.mdm_troubleshooting",
      "loggerLevel":"DEBUG"
   },
   {
      "loggerName":"ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao",
      "loggerLevel":"DEBUG"
   }
]

Parameters

Required:

  • loggerName – The name of the logger; it could be one of the pre-defined troubleshooting logger's names, or another Smile CDR or HAPI FHIR logger, see Troubleshooting Logs for possible values.
  • loggerLevel – The level of the logging; possible values: OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL. Note that TRACE and ALL are only permitted for the pre-defined troubleshooting loggers, and security-sensitive loggers (such as authentication and authorization providers) cannot be set finer than INFO.

Response:
Upon successful update, this method will return a 200 "ok" status with the contents of the updated log configuration as the response body.