If you are adding a new logging mechanism such as Log4perl to your program, I would highly recommend experimenting in a small program that only does logging. 95% of the code you've posted here has nothing to do with your issue. (See SSCCE.)

One thing that stands out is that you are instantiating your logger each time through the loop. You want it instantiated once and available in the loop. I also don't see any attempt to log an array -- or anything for that matter other than the test statements at error and warn.

Finally, you might consider whether a big logging framework is the right tool for your task or whether simply opening and appending to a file would be enough.


The way forward always starts with a minimal test.

In reply to Re: Log file by 1nickt
in thread Log file by MoodyDreams999

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.