trace_object.py

Sets a trace counter on the specified object and returns the object.

You can set trace counters on the following objects and all results are logged to mtx_debug.log:
  • MtxAccountObject
  • MtxDeviceObject
  • MtxGroupObject
  • MtxSubscriberObject
  • MtxUserObject

When tracing is enabled, an LM_TRACE message is logged with the ObjectId of the traced object and the current TraceCounter value allowing you to correlate messages (RelatedMsgId) using the ObjectId across different logical flow categories, task-chain executions, and processing servers.

Syntax

trace_object.py {-H URI} {-t IDX} [-h] [-f infile] [--save] [-ccount | -q] [--format=FORMAT]

Options

-h, --help
Prints help information for this script.
-H URI, --host=URI
Connect to MDC Gateway at specified host or host:port. Defaults to current pod.
-t IDX, --type=IDX
Object identifier type. One of ObjectId, ExternalId, Imsi, UserId. The default is ObjectId. Valid object classes are: MtxAccountObject, MtxDeviceObject, MtxGroupObject, MtxSubscriberObject, MtxUserObject.
-f infile, --file=infile
File containing Object IDs.
--save
Save matched objects to file named <MDCType>_<OID>.xml. The default is False.
-c <count>, --traceCounter=<count>
Set TraceCounter (integer) in matched objects(s).
-q, --query
Get matched objects(s). TraceCounter parameters are ignored and the target object is printed unmodified (checks the current TraceCounter setting without changing it).
--format=FORMAT
Output format for matched object(s). One of ElemXml, Compact, Xml, Verbose or Python. The default is ElemXml.
After running the following:
trace_object.py -t ObjectId 0:1:5:1 0:1:5:2 --traceCounter 10
The log file includes information for both objects:
LM_INFO  25868|25976 2021-05-25 10:56:13.151419 [charging_server_1:1:1:1(5230.82827)] MDC-8000658b894a76cc | SubManFunctions::traceDatabaseObject: Setting TraceCounter=10 on MtxMobileDeviceObject: OID=0:1:5:1
...
LM_INFO  25868|25978 2021-05-25 10:56:13.156675 [charging_server_1:1:1:1(5230.82827)] MDC-8001658b894a8bea | SubManFunctions::traceDatabaseObject: Setting TraceCounter=10 on MtxLoginDeviceObject: OID=0:1:5:2