From 792008217ed85c6c7fac68446464503d372bee12 Mon Sep 17 00:00:00 2001 From: Hugo Delaby Date: Mon, 7 Jun 2021 14:14:41 +0200 Subject: [PATCH] [rum] modified docs on simultaneous logging (#879) * [rum] modified docs on simultaneous logging * [rum] fix format * Update packages/logs/README.md Co-authored-by: Jorie Helwig Co-authored-by: Jorie Helwig --- packages/logs/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/logs/README.md b/packages/logs/README.md index 40b140a076..00af4d7afa 100644 --- a/packages/logs/README.md +++ b/packages/logs/README.md @@ -548,10 +548,14 @@ window.DD_LOGS && DD_LOGS.logger.setLevel('') ### Change the destination -By default, loggers created by the Datadog browser logs SDK are sending logs to Datadog. After the Datadog browser logs SDK is initialized, it is possible to configure the logger to send logs to the `console`, or to not send logs at all (`silent`) using to the API: +By default, loggers created by the Datadog browser logs SDK are sending logs to Datadog. After the Datadog browser logs SDK is initialized, it is possible to configure the logger to: + +- send logs to the `console` and Datadog (`http`) +- send logs to the `console` only +- not send logs at all (`silent`) ``` -setHandler (handler?: 'http' | 'console' | 'silent') +setHandler (handler?: 'http' | 'console' | 'silent' | Array) ``` ##### NPM @@ -562,6 +566,7 @@ For NPM, use: import { datadogLogs } from '@datadog/browser-logs' datadogLogs.logger.setHandler('') +datadogLogs.logger.setHandler(['', '']) ``` #### CDN async @@ -571,6 +576,7 @@ For CDN async, use: ```javascript DD_LOGS.onReady(function () { DD_LOGS.logger.setHandler('') + DD_LOGS.logger.setHandler(['', '']) }) ``` @@ -582,6 +588,7 @@ For CDN sync, use: ```javascript window.DD_LOGS && DD_LOGS.logger.setHandler('') +window.DD_LOGS && DD_LOGS.logger.setHandler(['', '']) ``` **Note**: The `window.DD_LOGS` check is used to prevent issues if a loading failure occurs with the SDK.