Skip to content

GetLogStatistics API

Returns log dates and entry counts for a specified log type over the last 365 days. Returns one entry per day in the window, including days with zero entries. Use this API to discover which dates have log data before calling GetLogs to retrieve the actual entries.

To control the lookback window explicitly, use GetLogStatistics1.

Endpoint

/srv.asmx/GetLogStatistics

Methods

  • GET /srv.asmx/GetLogStatistics?authenticationTicket=...&logType=...
  • POST /srv.asmx/GetLogStatistics (form data)
  • SOAP Action: http://tempuri.org/GetLogStatistics

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser
logType string Yes The type of log to query (see valid values below)

Valid logType Values

Value Description
Errors Application error logs
LoginAttempts Failed login attempt logs
Logins Successful login logs
Notifications Email notification logs
Information Informational entries
Warning Warnings
Upgrade What an upgrade did
Maintenance What the daily maintenance jobs did
IRConnect One record per infoRouter Connect call — see below

New in 9.2. Information, Warning, Upgrade and Maintenance have always been written by the server but could not be read back through this API until 9.2. IRConnect is new.

The IRConnect log

One record per call to the infoRouter Connect AI service, written when the call finishes — success or failure — and only when the instance has switched it on. It is off by default, so an instance that has not configured IRConnect.CallLogging will find no records here at all.

Each record carries which document, which operation, how long the call waited and took, what it returned in sizes and counts, and the token counts it was charged for. At the Full level it also carries the text sent and the content returned, which means document content on disk; see the IRConnect.CallLogging setting.

The logType parameter is case-insensitive.

Response

Success Response

<root success="true">
  <Statistics>
    <Value>
      <LogDate>2025-01-13</LogDate>
      <Count>5</Count>
    </Value>
    <Value>
      <LogDate>2025-01-14</LogDate>
      <Count>0</Count>
    </Value>
    <Value>
      <LogDate>2025-01-15</LogDate>
      <Count>12</Count>
    </Value>
  </Statistics>
</root>

Response Elements

Element Type Description
Statistics container Contains one Value entry per day in the 365-day window
Value container A single date entry
LogDate string The date in yyyy-MM-dd format, counting back from today
Count int Number of log entries for that date; 0 when no log file exists for the date

Error Response

<root success="false" error="[ErrorCode] Error message" />

Required Permissions

The caller must be an administrator or a member of [Audit Managers], who also see the server status, the warehouse status and the licence. Up to 8.7 only administrators could read the logs.

Example

Request (GET)

GET /srv.asmx/GetLogStatistics?authenticationTicket=abc123-def456&logType=Errors HTTP/1.1

Request (POST)

POST /srv.asmx/GetLogStatistics HTTP/1.1
Content-Type: application/x-www-form-urlencoded

authenticationTicket=abc123-def456&logType=Logins

Request (SOAP 1.1)

POST /srv.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/GetLogStatistics"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetLogStatistics xmlns="http://tempuri.org/">
      <authenticationTicket>abc123-def456</authenticationTicket>
      <logType>Errors</logType>
    </GetLogStatistics>
  </soap:Body>
</soap:Envelope>

JavaScript

Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and errorCode is the number to report.

async function call(action, params) {
  const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
  const root = new DOMParser()
    .parseFromString(await response.text(), 'text/xml')
    .documentElement;

  if (root.getAttribute('success') !== 'true') {
    throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
  }
  return root;
}

How many entries each day holds, as <Value> pairs of <LogDate> and <Count> under <Statistics>.

The log types it accepts are Errors, LoginAttempts, Logins, Notifications, Information, Warning, Upgrade, Maintenance and IRConnect. Anything else is answered 4000 with that list in the message.

const root = await call('GetLogStatistics', { authenticationTicket: ticket, logType: 'Errors' });

for (const day of root.querySelectorAll('Statistics > Value')) {
  console.log(day.querySelector('LogDate').textContent, day.querySelector('Count').textContent);
}

Two of the nine listed types do not work. Information and Warning answer 5000 carrying a DirectoryNotFoundException on an installation that has never written one of those logs - nothing creates the directory and this does not tolerate its absence. Reading the log itself does not behave that way: GetLogs for a date with nothing in it answers success.

Notes

  • Always returns the last 365 days, one entry per day
  • Every day in the window is returned, including days with Count=0
  • Count is the number of XML child elements in the log file for that date
  • Use returned LogDate values as the logDate parameter when calling GetLogs
  • To use a custom lookback window, use GetLogStatistics1

Error Codes

The errorCode values this operation returns, checked against a running server:

errorCode When
4010 the ticket is expired or unknown
4030 the caller is neither an administrator nor an Audit Manager - including a caller with no ticket
4000 a log type it does not recognise - the message lists the ones it does
5000 Information or Warning where that log has never been written - see above