core.medplumclient.setloglevel
Home > @medplum/core > MedplumClient > setLogLevel
MedplumClient.setLogLevel() method
Sets the log level for the client. - 'none': No logging - 'basic': Log method, URL, and status code only (no sensitive headers) - 'verbose': Log all details including headers (may include sensitive data)
Signature:
setLogLevel(level: ClientLogLevel): void;
Parameters
Parameter | Type | Description |
|---|---|---|
level | The log level to set. |
Returns:
void
Example 1
// Basic logging for production
medplum.setLogLevel('basic');
await medplum.searchResources('Patient');
// Output:
// > GET https://api.medplum.com/fhir/R4/Patient
// < 200 OK
Example 2
// Verbose logging for debugging
medplum.setLogLevel('verbose');
await medplum.searchResources('Patient');
// Output includes all headers