Logging subsystem writes log in xml file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<log version="1.0">
<message time="2011-04-11 17:10:10.0020" class="info">
la la la la..
</message>
I assume that writing in login file may crashes. In result xml log file may contain wrong xml data strings
for example
<message ti
Is exist convenient way of clearing xml file from wrong data parts,except of using regexp?
upd:wrong data parts can occur in middle of file not only in the end.
This is a great reason not to use XML as a logging format. Even without crashes, the log is never well-formed XML, since you never close the root tag.
As to how to clean it? Assuming you only get truncated files, read in the file, look for the last
"</message>", truncate there, add a"</log>", and try to parse it.