Your problem starts here:

my $log = bless Log::Log4perl->get_logger(caller()), __PACKAGE__;

You're subclassing Log::Log4perl package, but in constructor you're creating Log::Log4perl::Logger object and reblessing it into L4P::Subclass. I think you should in L4P::Subclass implement your own get_logger method which will return L4P::Subclass::Logger object.

Later in AUTOLOAD you're ignoring this logger object and creating a new one:

Log::Log4perl->get_logger(caller())->$method(@_);
but AUTOLOAD is called from your package from trace_start, so category is "L4P.Subclass" and not main. You can replace it with caller(1) or just use get_logger() as Log::Log4perl will automatically skip frames belonging to your module because you've registered it as wrapper. But in order this to work you should also fix the constructor, something as simple as:
sub new { return bless {}, shift; }
will do the thing, reblessing Logger object into L4P::Subclass somehow confuses Log4perl and AUTOLOAD invokes itself recursively.

PS: also note, that you can create custom log levels. I can't find documentation, but the code is in Log::Log4perl::Logger


In reply to Re: Subclassing L4P appears to generate fixed category log messages by zwon
in thread Subclassing L4P appears to generate fixed category log messages by Bloodnok

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.