Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:
So I'm trying to log what's happening in a certain subroutine in a certain module.
The module and sub definitely are being called because if I add die() to it, the system dies at the right point.
I'm probably trying to do something naive but I'm adding this to the module:
open(LOG,'>>','/var/log/customl.log') or die "can't open log";
To the module (in a BEGIN block or by itself), and it doesn't die, but it doesn't print anything to that log.
Then I put something like this in the key subroutine:
print LOG "Config is $config" or die $!;
And again, it doesn't die but it doesn't print.
I know this idea is probably very blunt force but there's no built-in logger for this system and I need to know what's happening in a complex web app.
Is it because this is on CentOS and it has extra security contexts which prevent me writing to that file? In that case, why doesn't it die? And how can I make it writeable? It can be anywhere, it doesn't have to be in /var/log
Thanks in advance
|
|---|