I often need to retrieve report files or logs from GoldenGate deployments, and I wanted to find ways of automating this. Hence this blog, about retrieving all available logs with GoldenGate REST API.
I previously wrote about the GoldenGate log files. Some of them (extract.log, replicat.log and others) are in fact just filters of other logs (ggserr.log or restapi.log). These reconstructed logs do not have a REST API endpoint. For the others, let’s see how to retrieve them, using the GoldenGate Python client I released earlier.
Authenticating to the REST API
With oggrestapi.py, authentication is handled once at client creation. When using auto_discovery, you won’t have to bother thinking about the port.
from oggrestapi import OGGRestAPI
ogg_client = OGGRestAPI(
url="https://vmogg:7809",
username="ogg",
deployment="ogg_test_01",
auto_discovery=True,
)
With auto_discovery, the client picks the right service port for each call. If you make direct curl/requests calls instead, you have to choose the service yourself:
- Service Manager for
ServiceManager.logand the deployment service logs (adminsrvr.log,distsrvr.log, etc.) - Administration Service for report files, diagnostic files,
ggserr.log. You can also retrieveadminsrvr.logfrom here.
The list of log files can be retrieved through GET /services/v2/logs. Each individual log is obtained through GET /services/v2/logs/{log}, on the port of the service you connect to. default is the service log: against adminsrvr (port 7810), default is adminsrvr.log. To retrieve the content of the file, you need to send the Accept: text/plain header, or use the content toggle in oggrestapi.py.
# /services/v2/logs - List all logs
>>> ogg_client.list_logs(ogg_service="adminsrvr")
[{'name': 'default'}, {'name': 'restapi'}, {'name': 'stdout'}, {'name': 'debug'}, {'name': 'events'}]
# /services/v2/logs/default - Get adminsrvr.log metadata
>>> ogg_client.get_log(log="default", ogg_service="adminsrvr")
{'$schema': 'ogg:log', 'enabled': True, 'dataExists': True}
# /services/v2/logs/default (Accept: text/plain) - Get adminsrvr.log content
>>> ogg_client.get_log(log="default", ogg_service="adminsrvr", content=True)
"...\n2026-09-26T17:21:30.612+0000 INFO | Registering containers <nul> (Thread 7)\n2026-09-26T17:21:31.820+0000 INFO | Configuration file 'EXT.prm' changed (Thread 7)\n2026-09-26T17:21:31.881+0000 INFO | Starting extract 'EXT' (EXTRACT:EXT)\n2026-09-26T17:21:31.915+0000 INFO | Task 'EXTRACT:EXT' started with process id 39143 (EXTRACT:EXT)\n"
You can also use the get_service_log directly, when using a reverse proxy or connecting to the Service Manager:
# /services/v2/deployments/ogg_test_01/services/distsrvr/logs/default (Accept: text/plain) - Service Manager endpoint
# /services/ServiceManager/v2/deployments/ogg_test_01/services/distsrvr/logs/default (Accept: text/plain) - reverse proxy endpoint
>>> ogg_client.get_service_log(deployment="ogg_test_01", service="distsrvr", content=True)
"...\n2026-09-26T17:33:46.183+0000 INFO | remove path Command Received for path PATHX (PATHX)\n2026-09-26T17:33:46.183+0000 WARN | Path stopped. (PATHX)\n"
The debug log is only relevant when you enable debug logging on a specific service. events is the critical events log (same content as ER-events.log), reachable directly as GET /services/v2/logs/events too, wrapped as list_log_events() :
# /services/v2/logs/events (Accept: text/plain)
>>> ogg_client.list_log_events(content=True)
"...Oracle GoldenGate Capture for Oracle, EXT.prm: Checkpoint marked as from graceful shutdown, but records found after checkpoint in trail pdb1/e1. Expected EOF Seqno 0, RBA 0. Found Seqno 7, RBA 8884.\n"
Service Manager logs
From the Service Manager (port 7809 in my lab), default is the ServiceManager.log:
# /services/v2/logs/default (Accept: text/plain)
>>> ogg_client.get_service_manager_log()
"...2026-09-26T15:46:20.138+0000 INFO | CSRFTokenProtection: ENABLED.\n Cross-Site Request Forgery checks using CSRF-Tokens will be performed. (Thread 12)\n"
get_service_manager_log() defaults to content=True, since fetching the metadata for this one specific log is not relevant (this log is always enabled).
ggserr.log
ggserr.log, the deployment-wide message log, is not one of the names any /logs collection returns. It is provided by a separate Administration Service endpoint at /services/v2/messages. A messages key returns the log lines.
# /services/v2/messages
>>> lines = ogg_client.list_messages()["messages"]
>>> len(lines)
53035
Once you find an OGG- message code in these lines, another endpoint (GET /services/v2/oggerr/{message}) returns its explanation:
>>> ogg_client.get_ogg_error_info(message="OGG-30375", ogg_service="adminsrvr")
{'$schema': 'ogg:messageExplanation', 'severity': 'ERROR', 'title': 'There was a problem updating the Administration Service resources.', 'cause': 'An internal error occurred when trying to update the service resources. Possible causes include a corrupted or incorrect resources repository.', 'action': 'Check the error log for other messages adjacent to this one that might help you resolve the problem. If you cannot resolve the problem, contact Oracle Support.'}
adminclient.log: no REST endpoint
adminclient.log is the client’s connection log. It is located in the client installation at $OGG_HOME/var/log/adminclient.log, not in any deployment, and no service can read it.
Report files (.rpt)
The report files are accessible with list_extract_reports and get_extract_report:
# /services/v2/extracts/EXT/info/reports
>>> ogg_client.list_extract_reports(extract="EXT")
[{'name': 'EXT.dsc'}, {'name': 'EXT.rpt'}]
# /services/v2/extracts/EXT/info/reports/EXT.rpt
>>> ogg_client.get_extract_report(extract="EXT", report="EXT.rpt")
{'lines': ['', '***********************************************************************', ' Oracle GoldenGate Capture for Oracle', ...], '$schema': 'ogg:report'}
get_current_extract_report() skips the .dsc, resolves the current .rpt for you, and returns None if the extract has no report listed :
# /services/v2/extracts/EXT/info/reports
# /services/v2/extracts/EXT/info/reports/EXT.rpt
>>> ogg_client.get_current_extract_report(extract="EXT")
{'lines': ['', '***********************************************************************', ' Oracle GoldenGate Capture for Oracle', ...], '$schema': 'ogg:report'}
The same endpoints/methods exist for replicats.
Diagnostics
If a diagnostics collection exists, it is a resource named {process}.diagnostics, listed under the same info path as reports. It has a status while it runs, and the start and finish times once done :
# /services/v2/extracts/EXT/info/diagnostics - while running
>>> ogg_client.list_extract_diagnostics(extract="EXT")
[{'name': 'EXT.diagnostics', 'status': 'running', 'started': '2026-09-26T17:23:21Z'}]
# /services/v2/extracts/EXT/info/diagnostics - when done
>>> ogg_client.list_extract_diagnostics(extract="EXT")
[{'name': 'EXT.diagnostics', 'status': 'stopped', 'started': '2026-09-26T17:23:21Z', 'finished': '2026-09-26T17:33:22Z'}]
When several collections exist, the previous ones are kept as EXT.diagnostics.1 (and so on), and the newest keeps the base name. An extract that never had a collection returns an empty list. It returns a JSON, but unlike reports and configuration files, it is a structured document with one entry per sample:
# /services/v2/extracts/EXT/info/diagnostics/EXT.diagnostics
>>> diag = ogg_client.get_extract_diagnostic(extract="EXT", diagnostic="EXT.diagnostics")
>>> list(diag)
['$schema', 'started', 'finished', 'collectionFrequency', 'collectionDuration', 'status', 'samples']
>>> diag["samples"][0]["processSamples"][0]["process"]
{'type': 'capture', 'state': {'status': 'waiting', 'detail': 'WAITING FOR TRANSACTION'}, 'bytesMined': 2264, 'bytesSent': 1524, 'messagesCaptured': 5, 'lag': 0}
The same pair exists for a replicat: list_replicat_diagnostics() / get_replicat_diagnostic().
Configuration files
GLOBALS, parameter files, and the rest of what a deployment keeps under its config directory come from /services/v2/config/files. That directory is $OGG_CONF_HOME, or $OGG_DEPLOYMENT_HOME/etc/conf. They return their content directly:
# /services/v2/config/files
>>> ogg_client.list_configuration_files(ogg_service="adminsrvr")
[{'name': 'EXT1.prm'}, {'name': 'EXT2.prm'}, {'name': 'REP1.prm'}, ...]
# /services/v2/config/files/EXT1.prm
>>> ogg_client.get_configuration_file(file="EXT1.prm", ogg_service="adminsrvr")
{'lines': ['EXTRACT EXT1', 'USERIDALIAS pdb1 DOMAIN OracleGoldenGate', 'EXTTRAIL qa/xa', 'TABLE APP_PDB1.TEST;'], '$schema': 'ogg:config'}
To summarize, for each file:
| File | API endpoint | oggrestapi. call |
|---|---|---|
Service logs (adminsrvr., etc.) | /services/v2/logs/default with Accept: text/plain | get_log('default', content=True) / get_service_log('default', content=True) |
Service Manager logs (ServiceManager., restapi.) | Same resource, against the Service Manager’s port | get_service_manager_log() |
ggserr. | /services/v2/messages | list_messages() |
adminclient. | None, it is a client-side file under <OGG_HOME>/var/log | None (filesystem only) |
extract. or replicat. | None, they are filtered views of ggserr. | None (filtered view) |
Reports (.) | /services/v2/extracts/{extract}/info/reports[/{report}] (or replicats), content returned directly | list_extract_reports() / get_extract_report(), or get_current_extract_report() / get_current_replicat_report() |
| Diagnostics | /services/v2/extracts/{extract}/info/diagnostics[/{diagnostic}] | list_extract_diagnostics() / get_extract_diagnostic() |
| Configuration files | /services/v2/config/files/{file} (content returned directly) | list_configuration_files() / get_configuration_file() |