Avatar of c11v11
c11v11
 asked on

Is there a file descriptor created for logfile using by logmsg within Perl script

We have a log file which is updated by one Perl script using logmsg.  But I find nothing when I am using lsof|grep logfile to try to find out the process id. Actually I already know which process but I also did not find this logfile descriptor in /proc/processid/fd.  Why?  What is the right way to find out this process ?
LinuxPerl

Avatar of undefined
Last Comment
Suhas .

8/22/2022 - Mon
ozo

How is logmsg defined?
c11v11

ASKER
sub logmsg {
    my ($msg) = @_;

    my $LOG = new IO::File::fcntl("$logFile",'a','lock_ex') or warn "$!";
    my $DateTime = strftime "%b %e %Y %T", localtime;
    if ($LOG) {
        print $LOG "$DateTime,$msg";
        print "$DateTime,$msg" if (! $daemon);
        close $LOG;
    }
}

How can I get the $LOG value? Is this the value for file descriptor?
ASKER CERTIFIED SOLUTION
bigbed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Suhas .

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: bigbed (http:#a40108719)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

suhasbharadwaj
Experts-Exchange Cleanup Volunteer
Your help has saved me hundreds of hours of internet surfing.
fblack61