Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18359

Re: where does the output of error_log(... ,4)?

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: where does the output of error_log(... ,4)?
Date 2020-09-05 12:26 +0200
Message-ID <hrh7dqF1bt3U1@mid.individual.net> (permalink)
References (2 earlier) <ril877$1dit$1@gioia.aioe.org> <hr92qtFa6rbU1@mid.individual.net> <riqvr3$1cai$1@gioia.aioe.org> <hrejusFf5soU1@mid.individual.net> <rivcsh$kre$1@gioia.aioe.org>

Show all headers | View raw


On 05/09/2020 08.57, Hostel wrote:
> Il 04/09/20 12:41, Arno Welzel ha scritto:
>> Hostel:
>>
>>> Il 02/09/20 10:18, Arno Welzel ha scritto:
>>>> Setting the error_log to the name 'err.log' is not enough. This must be
>>>> a full path and it must be writable by the user which executes the PHP
>>>> script (usually www-data, but that depends on your setup). Otherwise 
>>>> PHP
>>>> does not know where to put this file.
>>>>
>>>> Also see
>>>> <https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-log> 
>>>>
>>>
>>> the path is complete.
>>> I removed the initial part for privacy reasons
>>
>> And the user which runs the PHP script (www-data) has write access to
>> that path?
>>
>>
> 
> ini_set(
>      'error_log',
>      __DIR__ . '/err.log'
> );
> 
> $data = [
>      "error_log('abc', 4)"
>          => error_log('abc', 4),

You are telling the error logging system to use SAPI, this will let the 
web service to handle the log, look among your Apache logs.

I think you want to use "error_log('abc', 3)" to redirect the log to 
your log file.

If you have full control of the system that the script will be run on, I 
think syslog() is better way to log, you can redirect logs based on id 
and level to different files and on a high usage site syslog is far 
superior when it comes to write to disk than simple file write from php.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

where does the output of error_log(... ,4)? Hostel <f@f.f> - 2020-08-26 18:53 +0200
  Re: where does the output of error_log(... ,4)? "J.O. Aho" <user@example.net> - 2020-08-27 11:06 +0200
  Re: where does the output of error_log(... ,4)? Arno Welzel <usenet@arnowelzel.de> - 2020-08-30 14:21 +0200
    Re: where does the output of error_log(... ,4)? Hostel <f@f.f> - 2020-09-01 12:36 +0200
      Re: where does the output of error_log(... ,4)? Arno Welzel <usenet@arnowelzel.de> - 2020-09-02 10:18 +0200
        Re: where does the output of error_log(... ,4)? Hostel <f@f.f> - 2020-09-03 16:50 +0200
          Re: where does the output of error_log(... ,4)? Arno Welzel <usenet@arnowelzel.de> - 2020-09-04 12:41 +0200
            Re: where does the output of error_log(... ,4)? Hostel <f@f.f> - 2020-09-05 08:57 +0200
              Re: where does the output of error_log(... ,4)? "J.O. Aho" <user@example.net> - 2020-09-05 12:26 +0200
                Re: where does the output of error_log(... ,4)? Hostel <f@f.f> - 2020-09-05 15:46 +0200
              Re: where does the output of error_log(... ,4)? Arno Welzel <usenet@arnowelzel.de> - 2020-09-05 15:47 +0200
  Re: where does the output of error_log(... ,4)? Ace of diamonds <he12091983@gmail.com> - 2022-07-06 09:21 -0700

csiph-web