Skip to main content
Version: Next

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

NameDescriptionRequiredDefault
spring.cloud.oci.logging.enabledEnables the OCI Logging APIsNotrue

Sample

See spring-cloud-oci-logging-sample.