The definition of $href is outside the sub run_tests(). Move it inside and you might get more ...
use Data::Dumper; sub run_tests { my $href = shift; # by doubt always try to dump the data # print STDERR Dumper( $href ); foreach my $test (keys %{$href}) { $log->info("running test $test with parameters $href->{$test}" +); } exit; }
Log by original code:
2016/10/31 13:47:06 7732 [0] logger_1175005.pl 23 ess2_loader - loggin +g successfully 2016/10/31 13:47:06 7732 [0] logger_1175005.pl 29 ess2_loader - trying + to spawn child for periodic check... 2016/10/31 13:47:06 7732 [11] logger_1175005.pl 31 ess2_loader - succe +ssfully spawned PID -5796 2016/10/31 13:47:06 -5796 [11] logger_1175005.pl 34 ess2_loader - runn +ing check as PID -5796
After var moved:
2016/10/31 13:47:21 19276 [0] logger_1175005.pl 23 ess2_loader - loggi +ng successfully 2016/10/31 13:47:21 19276 [0] logger_1175005.pl 29 ess2_loader - tryin +g to spawn child for periodic check... 2016/10/31 13:47:21 19276 [14] logger_1175005.pl 31 ess2_loader - succ +essfully spawned PID -5168 2016/10/31 13:47:21 -5168 [14] logger_1175005.pl 34 ess2_loader - runn +ing check as PID -5168 2016/10/31 13:47:21 -5168 [19] Tools.pm 22 Tools.run_test - running te +st baz with parameters foobar 2016/10/31 13:47:21 -5168 [19] Tools.pm 22 Tools.run_test - running te +st foo with parameters bar

In reply to Re^3: Gettign a logger with Log::Log4perl by duyet
in thread Gettign a logger with Log::Log4perl by nikmit

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.