I think the better way to do it is to change $_SERVER["PHP_SELF"]
to "JFFNMS".  $_SERVER["argv"][0] will  make the log more readable.  
Have a lot of log files for each processes is not convient when one 
need to figure out the sequence between processes.  I end up update 
the function to below when I see the new changes did not fix the 
"problem":

    ....
    function logger($text, $show_date = true, $show_prg= true) {
        global $sat_id, $method;

        $text = (($show_prg==true)?
                basename($_SERVER[argv][0]).":" : "") . $text;
        $text = (($show_date==true)?date("H:i:s")." ":"").$text;
    ....

Min



-----Original Message-----
From: Eugene Turovsky [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 15, 2005 3:15 PM
To: Javier Szyszlican
Cc: [email protected]
Subject: Re: [jffnms-users] Logger in api.inc.php

Congratulation for new stable version JFFNMS!

It seems small problem with logfile naming remained (bellow). 
Scripts that executed from web interface make log with PHP_SELF prefix.
Scripts that executed by cron (poller and so on) make log without
prefix.
Variable $_SERVER["PHP_SELF"] in command line has no value. 
Min is right: in this case prefix must be $_SERVER["argv"][0]

Kind regards,
Eugene Turovsky

> Hi Min,
> 
> Thanks I fixed it removing hte $aux part.
> 
> Because $jffnms_logging_file is set to PHP_SELF on config.php
> 
> I tried it and it works.
> 
> Javier
> 
> Min Qiu wrote:
>> Hi
>> 
>> I found this log file name is odd:
>> 
>> [EMAIL PROTECTED] logs]# ls -l /opt/jffnms/logs/ total 120
>> -rw-r--r--  1 jffnms jffnms 105122 Jan 24 13:46 -2005-01-24.log
>> 
>> I trace the code to lib/api.ini.php
>>     ...
>>     function logger($text, $show_date = true) {
>>         global $sat_id, $method;
>> 
>>         $text = (($show_date==true)?date("H:i:s")." ":"").$text;
>> 
>>         if (get_config_option("jffnms_debug")==1) {
>> 
>>             $aux = (!isset($GLOBALS["jffnms_logging_file"]))
>>                 ?$_SERVER["argv"][0]
>>                 :$GLOBALS["jffnms_logging_file"];
>>      ...
>> 
>> By default, jffnms_logging_file is set to null so isset is always 
>> true thus we always have null.  Can it be change to 
>> ($GLOBALS["jffnms_logging_file"])?
>> $GLOBALS["jffnms_logging_file"]:$_SERVER["argv"][0];
>> 
>> Assume php will treat "" same as null/fault.
>> 
>> Min
>> 
>> 
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: IntelliVIEW -- Interactive 
>> Reporting Tool for open source databases. Create drag-&-drop reports.

>> Save time by over 75%! Publish reports on the web. Export to DOC,
XLS, RTF, etc.
>> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
>> _______________________________________________
>> jffnms-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jffnms-users
> 
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Javier Szyszlican, Project Leader, JFFNMS [EMAIL PROTECTED]
> 
> I hope JFFNMS or I were helpful to you, if you can, please donate at 
> http://jffnms.org/donate
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive 
> Reporting Tool for open source databases. Create drag-&-drop reports. 
> Save time by over 75%! Publish reports on the web. Export to DOC, XLS,
RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> jffnms-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jffnms-users
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide Read honest & candid
reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
jffnms-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jffnms-users



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
jffnms-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to