Logger (Python)

Description

When initializing the SDK, the options["logger"] object is an optional object. By default, an INFO level logger will be created under the adobe.target namespace. However, in order to customize log level or debug effectively when an issue occurs, a logger object can be provided when initializing the SDK.

The logger object is expected to have a debug() and an error() method. When an appropriate logger is provided, Target requests and responses will be logged.

Example

Python

logger = logging.getLogger("org.logger")
logger.setLevel(logging.DEBUG)

client_options = {
  "client": "acmeclient",
  "organization_id": "1234567890@AdobeOrg",
  "logger": logger
}
target_client = TargetClient.create(client_options)

You should see requests and responses being printed in the console.

recommendation-more-help
6906415f-169c-422b-89d3-7118e147c4e3