Logging
OCI Logging is a managed service for collecting and searching logs from OCI resources and applications.
Dependency Coordinates
Maven
<dependency>
<groupId>com.oracle.cloud.spring</groupId>
<artifactId>spring-cloud-oci-starter-logging</artifactId>
</dependency>
Gradle
dependencies {
implementation("com.oracle.cloud.spring:spring-cloud-oci-starter-logging")
}
Using Logging
The starter auto-configures a LogService bean for sending application logs to OCI Logging.
@Autowired
private LogService logService;
public void putLog() {
PutLogsResponse response = logService.putLog("log-text");
}
Set spring.cloud.oci.logging.logId in application configuration to target the destination log.
Configuration
| Name | Description | Required | Default |
|---|---|---|---|
spring.cloud.oci.logging.enabled | Enables the OCI Logging APIs | No | true |