• Object Storage Service

  1. Help Center
  2. Object Storage Service
  3. Developer Guide (PHP SDK)
  4. Initialization
  5. Configuring SDK Logging

Configuring SDK Logging

OBS PHP SDK provides the logging function based on the monolog log library. You can call ObsClient->initLog to enable and configure logging. Sample code is as follows:

$obsClient -> initLog ([
       'FilePath' => './logs', // Set the log folder.
       'FileName' => 'eSDK-OBS-PHP.log', // Set the name for the log file.
       'MaxFiles' => 10, // Set the maximum number of log files that can be retained.
       'Level' => WARN  // Set the log level.
  • The logging function is disabled by default. You need to enable it if needed.
  • For details about SDK logs, see Log Analysis.