in reply to Gettign a logger with Log::Log4perl
post 20 lines of code to show problem
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Gettign a logger with Log::Log4perl
by nikmit (Sexton) on Oct 31, 2016 at 11:28 UTC | |
I would expect the code in Tools.pm to log, but it does not. Couldn't quite restrict it to 20 lines, it is as short as I could get it: the parent process:
The module called from the child:
Whether I define the category as category.Tools or category.Tools.run_tests makes no difference in this example. To my understanding category settings propagate to sub-categories, unless these are defined with their own settings. That's why I originally defined the category as 'Tools', to cover all subroutines in Tools.pm | [reply] [d/l] [select] |
by duyet (Friar) on Oct 31, 2016 at 12:52 UTC | |
Log by original code: After var moved:
| [reply] [d/l] [select] |
by nikmit (Sexton) on Oct 31, 2016 at 16:04 UTC | |
Thank you - that indeed worked but only comes to show I failed to provide an adequate example as the problem persisted in my application :) I made an effort to further/better isolate the problem and I think I have a solution. I was starting Dancer2 with a system($plackup $args) command. After looking at the source code of plackup, I started it directly in a fork:
I need to check whether failures to start are captured correctly, but on the logging front its a win, plus it should be a better way to start it anyway I still don't know why it was failing before - I did check that processes are running the same version of perl and @INC is the same when started via system() and directly | [reply] [d/l] [select] |
by GotToBTru (Prior) on Oct 31, 2016 at 12:51 UTC | |
Line 6 refers to Tools::run_test while the actual sub is run_tests. Based on your previous remark about ess_loader vs supervisor, perhaps this is just another typo, but if not it might be the source of the problem. As an aside, you should be able to copy-and-paste code into posts here. The introduction of typos is an unnecessary distraction, especially since they are often the real culprit. | [reply] [d/l] [select] |