Edit in GitHubLog an issue

Logger

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#

Copied to your clipboard
1logger = logging.getLogger("org.logger")
2logger.setLevel(logging.DEBUG)
3
4client_options = {
5 "client": "acmeclient",
6 "organization_id": "1234567890@AdobeOrg",
7 "logger": logger
8}
9target_client = TargetClient.create(client_options)

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

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.