Skip to content

Instantly share code, notes, and snippets.

@adam-hert
Last active May 15, 2018 16:04
Show Gist options
  • Save adam-hert/29262ac88fc23c428d20891d8aaa8422 to your computer and use it in GitHub Desktop.
Save adam-hert/29262ac88fc23c428d20891d8aaa8422 to your computer and use it in GitHub Desktop.
Adding XML to traces via info events
<?php
print('XML example');
$xml = '<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Dont forget me this weekend!</body>
</note>';
$xml_short = substr($xml,0,10) . '...' . substr($xml, -10);
$xml_bytes = strlen($xml);
appoptics_log(null, 'info', array('xml' => $xml_short, 'xml_bytes'=>$xml_bytes));
print("end XML example");
?>
<?php
print('XML example');
$xml = '<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Dont forget me this weekend!</body>
</note>';
appoptics_log(null, 'info', array('xml' => $xml));
print("end XML example");
?>
@adam-hert
Copy link
Author

simple_xml example: image

@adam-hert
Copy link
Author

advanced_xml example (better for very large xml blocks):
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment