Hello monks, I am yet again in need for some guidance.

Very often, from my pov, the question of log format is only put when the log is there and we have to parse it. I have the opportunity to decide the log format for new Perl scripts, and I seek you advice to choose the best solution

I am logging outputs from a mainframe, and for each reference, I have to log the main screen of the record, and depending on the need, I have to issue several commands on this record and log them. For the moment, I am only logging outputs in a flat text file, each record being separate by a line of '-', and inside each section, each entry is starting with a line like '>MD' where '>' is the prompt and 'MD' a command (example).

I am now looking for a smarter way to log the output, but I guess that it could be also useful to log the actions taken on the record, and various information technical and functional extrapolated by the script. Instead of using a flat file, I am interested by the XML format. What do you think ? is there a better format ? also, what would be for you the ideal format to mix outputs and other information in a single log file?

As a minor question, what is for you the best module to write and read simple XML files used for logging activity?


In reply to Efficient log format by jeepj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.