Configuring SDK Logging

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference

OBS Java SDK provides the logging function, based on the Apache Log4j2 open library. The SDK records WARN logs to the path represented by the JDK system variable user.dir, by default. You can modify log configuration files to configure logging based on your needs. The procedure is as follows:

  1. Find the log4j2.xml file in the OBS Java SDK development package.
  2. Modify log levels and save paths in the log4j2.xml file based on actual needs.
  3. Save the log4j2.xml file to the classpath root directory, or call Log4j2Configurator.setLogConfig to specify the save path of log4j2.xml directly.
  • For details about SDK logs, see Log Analysis.
  • You can modify the log4j2.xml file to configure the log file permissions based on your actual needs.