Help Center/
Object Storage Service/
SDK Reference/
Java/
Initialization (SDK for Java)/
Configuring SDK Logging (SDK for Java)
Updated on 2024-01-16 GMT+08:00
Configuring SDK Logging (SDK for Java)
OBS SDK for Java offers logging based on the open-source Apache Log4j 2 library. By default, the SDK stores WARN log files to the directory specified by the JDK system variable user.dir. You can modify the log configuration file based on your needs.
Procedure
- Obtain the file log4j2.xml from the OBS SDK for Java package.
- Modify the log level and storage path in the file as required.
- Save the file to the classpath root directory, or call Log4j2Configurator.setLogConfig to specify the storage path of the file.
- For details about SDK logging, see Log Analysis (SDK for Java).
- You can modify the log4j2.xml file to configure access permissions for log files.
Parent topic: Initialization (SDK for Java)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot