• Object Storage Service

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

Configuring SDK Logging

OBS Node.js SDK provides the logging function based on Log4js. You can call ObsClient.initLog to enable and configure logging. Sample code is as follows:

obsClient.initLog({ 
       file_full_path:'./logs/OBS-SDK.log', // Configure the log file path. 
       max_log_size:20480, // Configure the log file size, in bytes.
       backups:10, // Configure the maximum number of retained log files.
       level:'warn', // Configure the log level. 
       log_to_console:true// Configure whether to print logs to Console.
});
NOTE:
  • The logging function is disabled by default. You need to enable it if needed.
  • For details about SDK logging, see section Log Analysis.