getSystemLog method

Future<SystemInformation> getSystemLog(
  1. String logType, {
  2. String? writeLogToFolder,
})

This operation gets a system log from the device. The exact format of the system logs is outside the scope of this standard however a common format for the system log response is SOAP Message Transmission Optimization Mechanism (MTOM) which is the use of MIME to optimize the bit stream transmission of SOAP messages that contain significantly large base64Binary elements.

Access Class: READ_SYSTEM_SECRET

Implementation

Future<SystemInformation> getSystemLog(
  String logType, {
  String? writeLogToFolder,
}) async {
  loggy.debug('getSystemLog');

  final securedXml = transport
      .getSecuredEnvelope(soap.Body(
        request: DeviceManagementRequest.getSystemLog(logType),
      ))
      .toXml(soap.Transport.builder);

  final response = await transport.sendLogRequest(
    uri,
    securedXml,
  );

  String xmlString = parseMtom(response, writeLogToFolder: writeLogToFolder);

  loggy.debug('\ngetSystemLog - RESPONSE:\n$xmlString');

  final responseEnvelope = soap.Envelope.fromXmlString(xmlString);

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return GetSystemLogResponse.fromJson(responseEnvelope.body.response!)
      .systemLog;
}