OCI Logging Explained

Share

Oracle Cloud Infrastructure Logging

Oracle Cloud Infrastructure (OCI) Logging is one of the most important monitoring and observability services available in modern Oracle Cloud environments. Organizations running workloads on Oracle Cloud Infrastructure need centralized visibility into application activity, security events, audit trails, infrastructure performance, and operational issues. OCI Logging helps administrators, cloud architects, DevOps teams, and security teams collect, store, search, and analyze logs generated across OCI services and custom applications.

In real enterprise implementations, OCI Logging becomes a critical component for:

  • Security monitoring
  • Infrastructure troubleshooting
  • Compliance auditing
  • Incident investigation
  • Performance analysis
  • Application diagnostics
  • SIEM integrations

With OCI’s latest cloud architecture standards and 26A ecosystem updates, OCI Logging integrates tightly with services like Logging Analytics, Monitoring, Notifications, Service Connector Hub, Functions, Kubernetes Engine (OKE), API Gateway, and Object Storage.

This article explains Oracle Cloud Infrastructure Logging in detail from an implementation perspective, including architecture, setup, integrations, troubleshooting, and best practices.


What is Oracle Cloud Infrastructure Logging?

OCI Logging is a fully managed cloud-native service used to collect, store, search, and manage logs from Oracle Cloud Infrastructure resources and custom applications.

The service supports:

  • OCI service logs
  • Audit logs
  • Custom application logs
  • Infrastructure logs
  • Kubernetes logs
  • Function execution logs
  • Load balancer logs
  • VCN flow logs
  • Database logs

OCI Logging provides centralized visibility into cloud operations without the need to maintain separate logging servers.


Types of Logs in OCI

OCI primarily supports two major log categories:

Log TypeDescription
Service LogsGenerated automatically by OCI services
Custom LogsUser-defined application or operating system logs

Service Logs

Generated by OCI services automatically.

Examples:

  • Load Balancer Access Logs
  • API Gateway Logs
  • Object Storage Logs
  • VCN Flow Logs
  • Functions Logs
  • OKE Cluster Logs

Custom Logs

Created by users or applications.

Examples:

  • Linux syslog
  • Application logs
  • Java application logs
  • Apache server logs
  • Middleware logs

Key Features of OCI Logging

Centralized Log Management

All logs can be collected into a centralized OCI Logging service for simplified administration.

Real-Time Log Search

OCI Logging provides fast querying and filtering capabilities.

Integration with OCI Services

OCI Logging integrates seamlessly with:

  • OCI Monitoring
  • OCI Notifications
  • OCI Events
  • OCI Logging Analytics
  • OCI Object Storage
  • OCI Streaming

Fine-Grained IAM Security

Access to logs can be controlled using OCI IAM policies.

Long-Term Retention

Logs can be archived to Object Storage for compliance purposes.

Real-Time Alerting

Teams can configure alerts based on specific log patterns.


Real-World Integration Use Cases

Scenario 1 – Security Monitoring for Financial Systems

A banking organization uses OCI Logging to monitor unauthorized API calls, failed login attempts, and suspicious network traffic.

Logs are forwarded to SIEM tools like:

  • Splunk
  • IBM QRadar
  • Azure Sentinel

This helps the security team detect anomalies quickly.


Scenario 2 – Kubernetes Application Troubleshooting

An enterprise running microservices on Oracle Kubernetes Engine (OKE) sends container logs to OCI Logging.

DevOps engineers can:

  • Trace failed pods
  • Analyze container crashes
  • Identify application bottlenecks
  • Monitor deployment failures

Scenario 3 – Compliance and Audit Tracking

Healthcare organizations use OCI Audit logs and Logging Analytics to maintain regulatory compliance.

Typical monitored activities include:

  • User creation
  • IAM policy changes
  • Database access
  • Network modifications

OCI Logging Architecture

OCI Logging architecture consists of multiple components working together.

Main Components

ComponentPurpose
Logging ServiceCentral log ingestion and management
Log GroupsLogical grouping of logs
AgentsCollect logs from compute instances
Service Connector HubMoves logs between OCI services
Logging AnalyticsAdvanced log analysis
Object StorageLong-term archival

How OCI Logging Works

The typical flow is:

  1. OCI service generates logs
  2. Logs are sent to OCI Logging
  3. Logs are stored in Log Groups
  4. Users search or analyze logs
  5. Optional routing to:
    • Object Storage
    • Streaming
    • SIEM tools
    • Notifications

Supported OCI Services for Logging

OCI Logging supports many Oracle Cloud services.

OCI ServiceLogging Support
ComputeYes
Load BalancerYes
API GatewayYes
FunctionsYes
OKEYes
VCNYes
Object StorageYes
DatabasePartial
WAFYes

Prerequisites for OCI Logging Setup

Before configuring OCI Logging, ensure the following:

Required IAM Permissions

Example IAM policy:

 
Allow group LoggingAdmins to manage log-groups in tenancy
Allow group LoggingAdmins to manage logs in tenancy
Allow group LoggingAdmins to read compartments in tenancy
 

Required OCI Components

  • OCI tenancy
  • Compartments
  • Compute instances
  • OCI CLI (optional)
  • Dynamic groups (optional)

Step-by-Step OCI Logging Configuration

Step 1 – Create a Log Group

Navigation:

 
OCI Console → Observability & Management → Logging → Log Groups
 

Click:

 
Create Log Group
 

Example:

FieldValue
NameProduction-Logs
CompartmentPROD-COMP
DescriptionProduction application logs

Click:

 
Create
 

Step 2 – Enable Service Logs

Navigation:

 
OCI Console → Logging → Logs
 

Click:

 
Enable Service Log
 

Example:

FieldValue
ServiceLoad Balancer
ResourcePROD-LB
CategoryAccess Logs
Log GroupProduction-Logs

Save configuration.


Step 3 – Install Unified Monitoring Agent

For custom logs from compute instances:

Oracle Linux Installation

 
sudo yum install unified-monitoring-agent
 

Start agent:

 
sudo systemctl start unified-monitoring-agent
 

Enable auto-start:

 
sudo systemctl enable unified-monitoring-agent
 

Step 4 – Configure Agent

Edit configuration file:

 
/etc/unified-monitoring-agent/conf.d/custom_logs.conf
 

Example:

 
{
"logs": [
{
"name": "app-log",
"file_path": "/var/log/app.log",
"log_group_id": "ocid1.loggroup.oc1..."
}
]
}
 

Restart agent:

 
sudo systemctl restart unified-monitoring-agent
 

Step 5 – Search Logs

Navigation:

 
OCI Console → Logging → Search
 

Example query:

 
search "Production-Logs"
 

Advanced query:

 
search "Production-Logs | where data.status='500'"
 

Step 6 – Configure Log Retention

OCI allows retention customization.

Example:

EnvironmentRetention
Development30 Days
Production90 Days
Compliance Logs365 Days

OCI Logging with Service Connector Hub

Service Connector Hub is heavily used in enterprise OCI environments.

It enables automated log routing.

Common Integrations

SourceDestination
LoggingObject Storage
LoggingStreaming
LoggingFunctions
LoggingNotifications

Example – Archive Logs to Object Storage

Step 1 – Create Object Storage Bucket

Navigation:

 
OCI Console → Object Storage → Buckets
 

Example bucket:

 
prod-log-archive
 

Step 2 – Create Service Connector

Navigation:

 
OCI Console → Service Connector Hub
 

Configuration:

FieldValue
SourceLogging
TargetObject Storage
Log GroupProduction-Logs

Activate connector.

Now logs automatically move to Object Storage.


OCI Logging Analytics

OCI Logging Analytics provides advanced capabilities beyond basic logging.

Features include:

  • Machine learning analysis
  • Pattern recognition
  • Anomaly detection
  • Root cause analysis
  • Security insights

Real-World Usage

Large enterprises use Logging Analytics for:

  • Application dependency mapping
  • Threat detection
  • Capacity analysis
  • Operational intelligence

OCI Logging for Kubernetes (OKE)

Oracle Kubernetes Engine integrates directly with OCI Logging.

Common OKE Logs

Log TypePurpose
Container LogsApplication debugging
Node LogsInfrastructure troubleshooting
Audit LogsSecurity tracking

Enable OKE Logging

Navigation:

 
OCI Console → Developer Services → Kubernetes Clusters
 

Enable:

  • Control Plane Logs
  • Audit Logs
  • Worker Node Logs

OCI Audit vs OCI Logging

Many beginners confuse Audit and Logging services.

| Feature | OCI Audit | OCI Logging |
|—|—|
| Tracks API Calls | Yes |
| Tracks Infrastructure Events | Limited |
| Custom Logs | No |
| Service Logs | No |
| Retention | Fixed |
| Search Capability | Basic |

Audit focuses on governance and API tracking, while Logging handles operational observability.


Testing OCI Logging

Testing is essential after implementation.

Test Scenario – Compute Instance Log

Generate sample log:

 
echo "Application Failure Test" >> /var/log/app.log
 

Validate

Go to:

 
OCI Console → Logging Search
 

Search:

 
Application Failure Test
 

Expected result:

  • Log entry appears successfully
  • Timestamp is correct
  • Hostname is visible

Common Errors and Troubleshooting

Issue 1 – Logs Not Appearing

Causes

  • Agent stopped
  • IAM policy missing
  • Wrong file path

Resolution

Verify agent:

 
systemctl status unified-monitoring-agent
 

Issue 2 – Permission Denied

Cause

OCI IAM policy missing.

Resolution

Add required policies.


Issue 3 – High Log Volume

Cause

Excessive debug logging.

Resolution

  • Filter unnecessary logs
  • Use retention policies
  • Archive older logs

Issue 4 – Delayed Logs

Cause

Network latency or ingestion delay.

Resolution

  • Verify VCN connectivity
  • Check service health
  • Validate agent buffering

Best Practices for OCI Logging

Use Separate Log Groups

Create different groups for:

  • Production
  • Non-production
  • Security
  • Applications

Implement Log Retention Policies

Avoid storing logs indefinitely.

Use:

  • Short retention for development
  • Long retention for audit logs

Integrate with Notifications

Configure alerts for:

  • Failed logins
  • API errors
  • Security violations
  • Infrastructure failures

Use Structured Logging

JSON logs are easier to parse and analyze.

Example:

 
{
"status": "500",
"service": "payments",
"message": "transaction failed"
}
 

Secure Sensitive Data

Avoid logging:

  • Passwords
  • Tokens
  • Personal information
  • Credit card data

Use Logging Analytics for Large Environments

Basic logging works well for small workloads, but large enterprises benefit significantly from Logging Analytics.


Practical Consultant Tips

Tip 1 – Always Enable Audit Logging

Audit logs are extremely important during compliance reviews and incident investigations.


Tip 2 – Avoid Excessive Debug Logging in Production

Debug logs increase:

  • Storage cost
  • Search complexity
  • Ingestion overhead

Tip 3 – Standardize Naming Conventions

Example:

ResourceNaming Example
Log GroupPROD-SECURITY-LOGS
ConnectorPROD-LOG-ARCHIVE
Bucketprod-log-storage

Tip 4 – Use Compartments Properly

Separate environments using dedicated OCI compartments.


Frequently Asked Questions

FAQ 1 – Is OCI Logging free?

OCI provides limited free logging storage and ingestion. Additional usage is billed based on storage and ingestion volume.


FAQ 2 – Can OCI Logging integrate with external SIEM tools?

Yes. OCI Logging integrates with tools like Splunk, QRadar, and Azure Sentinel using Service Connector Hub, Streaming, or APIs.


FAQ 3 – What is the difference between Logging and Logging Analytics?

Logging stores and searches logs, while Logging Analytics provides advanced machine learning, anomaly detection, and deep operational insights.


Summary

Oracle Cloud Infrastructure Logging is a foundational observability service for modern cloud environments. It enables organizations to centralize logs, monitor applications, improve security visibility, troubleshoot issues, and meet compliance requirements.

In real Oracle Cloud implementations, OCI Logging becomes essential for:

  • Security operations
  • DevOps monitoring
  • Infrastructure troubleshooting
  • Compliance auditing
  • Application diagnostics

A properly designed logging strategy improves operational stability and helps organizations proactively identify issues before they impact business users.

For additional technical details, refer to the official Oracle documentation:

Oracle Cloud Infrastructure Documentation

OCI Logging Documentation

OCI Training Demo Day 1 Video:

You can find more information about Oracle Cloud Infrastructure application in this Oracle Docs Link

 

Conclusion:

Unogeeks is the No.1 Training Institute for Oracle Cloud Infrastructure Training. Anyone Disagree? Please drop in a comment

You can check out our other latest blogs on Oracle Cloud Infrastructure (OCI) in this Oracle Cloud Infrastructure (OCI) Blogs

You can check out our Best in Class Oracle Cloud Infrastructure Training details here – Oracle Cloud Infrastructure Training

 Follow & Connect with us:

———————————-

For Training inquiries:

Call/Whatsapp: +91 73960 33555

Mail us at: info@unogeeks.com

Our Website ➜ https://unogeeks.com

Follow us:

Instagram: https://www.instagram.com/unogeeks

Facebook: https://www.facebook.com/UnogeeksSoftwareTrainingInstitute

Twitter: https://twitter.com/unogeeks


Share

Leave a Reply

Your email address will not be published. Required fields are marked *