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


Groups > comp.lang.php > #18406

Re: log_errors = Off not work

From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: log_errors = Off not work
Date 2020-11-18 17:09 +0100
Message-ID <i1kv9bFm9upU1@mid.individual.net> (permalink)
References <rp2mf7$14ir$1@gioia.aioe.org> <i1kkt8Fk9stU1@mid.individual.net> <rp3f76$1kek$1@gioia.aioe.org>

Show all headers | View raw


On 18/11/2020 16.39, alex wrote:
> Il 18/11/20 14:12, J.O. Aho ha scritto:
>> On 18/11/2020 09.36, alex wrote:
>>> $ grep 'log_errors =' /etc/php/7.4/cli/php.ini
>>> log_errors = Off
>>>
>>> $ date && php -r "error_log('abc');" && ls -l /var/log/error.log
>>> mer 18 nov 2020, 09:25:58, CET
>>> -rw-rw-r-- 1 xxx yyy 25931 nov 18 09:25 /var/log/error.log
>>>
>>> As you can see log_errors is Off, but it seems that the log file is 
>>> written: just compare the current date with the file date.
>>>
>>> Why?
>>
>> Did you do a tail /var/log/error.log to see that it was your message 
>> that was written there and not something else that just happen to have 
>> the same minute for it's log write?
>>
>> Are you sure your php cli is version 7.4?
>>
>> did you try to just comment it out by placing ; as the first character 
>> of the line? Sometimes non-visible characters may cause problems.
>> (default value is Off)
>>
>> did you uncomment error_log = syslog or set a custom file?
>>
> 
> + php -v
> PHP 7.4.3 (cli) (built: Oct  6 2020 15:47:56) ( NTS )
> Copyright (c) The PHP Group
> Zend Engine v3.4.0, Copyright (c) Zend Technologies
>      with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
>      with Xdebug v2.9.2, Copyright (c) 2002-2020, by Derick Rethans
> 
> + grep 'log_errors =' /etc/php/7.4/cli/php.ini
> ;log_errors = On
> 
> + grep 'error_log =' /etc/php/7.4/cli/php.ini
> ;error_log = php_errors.log
> ;error_log = syslog
> error_log = /var/log/error.log
> 
> + php -r 'error_log('\''abc'\'');'
> 
> + tail -n 1 /var/log/error.log
> [18-Nov-2020 16:27:59 Europe/Berlin] abc
> 
> + sleep 3
> 
> + php -r 'error_log('\''abc'\'');'
> 
> + tail -n 1 /var/log/error.log
> [18-Nov-2020 16:28:02 Europe/Berlin] abc
> 
> As you can see the file is written: 16:27:59 < 16:28:02
> But why?

test again after you commented error_log.

-- 

  //Aho

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


Thread

log_errors = Off not work alex <1j9448a02@lnx159sneakemail.com.invalid> - 2020-11-18 09:36 +0100
  Re: log_errors = Off not work "J.O. Aho" <user@example.net> - 2020-11-18 14:12 +0100
    Re: log_errors = Off not work alex <1j9448a02@lnx159sneakemail.com.invalid> - 2020-11-18 16:39 +0100
      Re: log_errors = Off not work "J.O. Aho" <user@example.net> - 2020-11-18 17:09 +0100
        Re: log_errors = Off not work alex <1j9448a02@lnx159sneakemail.com.invalid> - 2020-11-18 17:25 +0100
          Re: log_errors = Off not work Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-11-18 17:39 +0000
            Re: log_errors = Off not work alex <1j9448a02@lnx159sneakemail.com.invalid> - 2020-11-19 16:27 +0100
  Re: log_errors = Off not work Arno Welzel <usenet@arnowelzel.de> - 2020-11-19 15:42 +0100
    Re: log_errors = Off not work alex <1j9448a02@lnx159sneakemail.com.invalid> - 2020-11-19 19:22 +0100

csiph-web