Movatterモバイル変換


[0]ホーム

URL:


Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceRecipesChangelogUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog InFeature Experimentation
Dev guide
All
Pages
Start typing to search…

Customize PHP SDK logger

Customize log information from the Optimizely Feature Experimentation PHP SDK for debugging experiments.

Thelogger captures details about your experiments, making it easier for you to debug them. You can customize where the log information is stored and choose the types of data you want to track.

The PHP SDK comes with a defaultLogger implementation. To configure the log level threshold, pass the log level as an argument to theDefaultLogger constructor.

use Monolog\Logger;use Optimizely\Logger\DefaultLogger;/** * To set a log level choose one of the following: *  * INFO: Logger.INFO * DEBUG: Logger.DEBUG * WARNING: Logger.WARNING * ERROR: Logger.ERROR * CRITICAL: Logger.CRITICAL * * To define a different minimum logging level pass it in during initialization * The example below shows a minimum logging level of WARNING and outputs * to standard out */$optimizelyClient = new Optimizely($datafile, null, newDefaultLogger(Logger::WARNING, "stdout"));

Pass in a custom logger for your Optimizely client for finer control over your SDK configuration in a production environment. A custom logger is an instance of a class that implementsLoggerInterface

Log levels

The following list shows the log levels for the Ruby SDK.

  • CRITICAL – Logs events that cause the app to crash.
  • ERROR – Logs events that prevent feature flags from working properly, such as an invalid data file during initialization or incorrect feature keys. These issues require user intervention to fix.
  • WARN – Logs events that do not prevent feature flags from working properly but may cause unexpected results, such as future API deprecation, improper logger or error handler settings, and nil values from getters.
  • INFO – Logs key events to illustrate the lifecycle of an API call, such as when a decision or tracking starts and succeeds.
  • DEBUG – Logs extra information related to errors that aid Optimizely in debugging, like when a feature flag is not running or a user is not included in a rollout.

Updated 17 days ago



[8]ページ先頭

©2009-2025 Movatter.jp