I'm (still) attempting (in my spare time, ha-ha) to move some software off of my own custom logging solution to Log4perl.
I have need to be able to have an appender to that updates a variable within the code so I can easily display this to the user as the program runs via a Tkx label widget. I haven't been able to sort out how to do this, as the two obvious solutions (Log::Log4perl::Appender::String and read it, or Log::Log4perl::Appender with Log::Dispatch::File, and have it write to a filehandle that's a variable) don't work in any fashion that I've tried: String requires a direct call to the Appender to get it triggered, and File doesn't seem to accept anything but a scalar as an argument, so a reference to a FH seems to be a non-starter.
There seems to be the idea that you can roll your own, but the documentation in the FAQ and the few other places I've found is somewhat sparse, as there are a variety of ways to get the data that I'm wanting, that probably fits the other nearly 100% of the use cases. A more complete document (or possibly one that makes fewer assumptions about the person needing to write something of this nature) on this would possibly be sufficient, since what I'm doing is seemingly fairly simple.
The structure of L4p seems to be pretty rigid, which is kind of surprising to me: It doesn't seem to fit nicely with the idea of TIMTOWTDI. Then again, I may not be wise enough to understand the subtleties that are involved. I'm not above admitting it.
In reply to Log4perl appender to write to scalar? by jellisii2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |