The Java world had an… interesting weekend when security researchers revealed on December 9 a vulnerabilityin the popular Apache Log4j 2software library for recording and debugging events. Systems as diverse as Amazon Web Services, Apple iCloud, and the Minecraft video gamecould be exploited to run arbitrary code on a server merely by sending a specially-crafted string of text. Information technology professionals have been scrambling ever since the initial disclosure to patch, upgrade, reconfigure, or otherwise protect affected servers. It’s bad, and past unpatched vulnerabilities like thishave been responsible for the exposure of millions of people’s sensitive data.
Many Perl applications use the similarly-named and ‑designed Log::Log4perllibrary, and the good news is that as far as I can tell the latter doesn’t suffer from the type of vulnerability described above. This doesn’t mean poorly-written or ‑configured Perl-based systems are immune to all exploits, just this particular one.You should be safe to continue using Log4perl unless someone has deliberately configured it otherwise, and in fact, my workuses it extensively.
You might be surprised to read me suggesting a logging framework after writing multiple articles espousing the Perl step debuggeras an alternative. Log4perl developer Mike Schilli’s 2002 introduction to the package for Perl.comcame down on the opposite side of the argument. It can seem like one of those programmer religious issues like tabs vs. spaces, vim vs. Emacs, or Linuxvs. Windows. (For the record, the correct answers are spaces, BBEdit, and macOS. 😉)
But in this case, you can and should have the best of both worlds—logging at different levelsto appropriate destinationswhile still dropping into the interactive debuggerwhen you need to do something trickier like examine program state or tweak a data structure on the fly. I use both techniques and only emphasize the advocacy of step debugging because it’s understood less.