Last active
May 15, 2018 16:04
-
-
Save adam-hert/29262ac88fc23c428d20891d8aaa8422 to your computer and use it in GitHub Desktop.
Adding XML to traces via info events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
advanced_xml example (better for very large xml blocks):
