Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119237 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 47181 invoked from network); 6 Jan 2023 13:00:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Jan 2023 13:00:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 43FAA1804B4 for ; Fri, 6 Jan 2023 05:00:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 6 Jan 2023 05:00:17 -0800 (PST) Received: by mail-pj1-f47.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso5173166pjt.0 for ; Fri, 06 Jan 2023 05:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=team.bumble.com; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Hjsg0Pn/DiJ4Am0Jn8UtL/dG8HV+SnUev8DNaHUl04U=; b=nuyPtdXuHhmaGJOeLuc/g8VAUac0cUGMYyYbihnI/nLHiFBbSTx2kqAEUKUs6DLqrx SM56EbJwSAt/j60F5oStF3glEqWCXCCu+dEZhRGNDzDCC/+wpmqll1u/mNkDrntMoPoB e1o1NPZp8tijj2wTnOTL+/0Wh0T53fsqSvCw4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hjsg0Pn/DiJ4Am0Jn8UtL/dG8HV+SnUev8DNaHUl04U=; b=t7FPoUGMhDjaLFp3HNFcWWS3MxyLtTjx3p8JuNnibRb1mqCeYNCNOghPdowtdgVMm6 HYRTii1eP6AzI4Q+6eH2JvufOcHaWKU1p6+fdMDs+J2eRKCymIqby3jqk5hdM/W4rsOj fyqdeV9n9C4ur4Ykkh5DpLjxAKlpLiP7GhP2s464FjpDfDJEPZgWtpdGVhuvPCY301nt QQxOEVqI+i+42GY02+M0a/NK3cv7pZsNtmIb2BiZKTMD30a+MZrOIwcf8fvlmXSXVKvZ qRjCFy/gjFFmrngK3Tl/Be2+Z0ulxnst9KO/xof7vlt10tK+NUJpdf6Yh1LRXb8TwYTY D4BQ== X-Gm-Message-State: AFqh2koUFJIqPe9AodR/rh10Y7yd0N1JnL0xXdqFTFlJ9Lzs8D8KvoJw D76sGR/psJJtXE7RSEtee5kPSxc3Tr3R63JikoEuxO1wuDMdSpHz X-Google-Smtp-Source: AMrXdXu0Kt3y+m17gWhgCQUQeR3HszkMINqeeZQdvj5wF8LHhdlAFSPnOZdBpk8WktxQCioj6DY0EkkL0VC3uIORXeQ= X-Received: by 2002:a17:902:ca89:b0:189:8f65:5792 with SMTP id v9-20020a170902ca8900b001898f655792mr2668202pld.114.1673010016614; Fri, 06 Jan 2023 05:00:16 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Mikhail Galanin Date: Fri, 6 Jan 2023 12:59:40 +0000 Message-ID: To: Jakub Zelenka Cc: Derick Rethans , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Microseconds to error log From: internals@lists.php.net ("Mikhail Galanin via internals") Hi Derick, Jakub and the team, Thank you so much for your input. Sorry for being so slow with this -- I haven't forgotten, it's just unfortunately, I'm not capable to handle all the things going around but I keep trying :) I did some research about why we keep using plain log files and our folks basically follow what Jakub said - we have our custom log collector (similar to Scribe, Fluentd and others) which has quite complicated routing rules and it was pretty straightforward to use files but adding Syslog adds undesirable complexity to this system. Although, it certainly doesn't look impossible. Speaking about backward compatibility stuff - I can think of another option, to postpone such a change till PHP v9.0, where we tend to introduce breaking changes. We are not a startup anymore - can wait for a couple of years. I saw the suggestion to draft an RFC for this to thoroughly walk through the question. I'm pretty open to this but it'll take a lot of time. So guys, do you feel it's feasible to do? I can imagine some people don't want to be harsh to say "please, stop this nonsense" :) I can see that this change might not bring a lot of value and appeared to be controversial so I'm fine to stop - we can keep this as our private patch. But if someone feels it might be something good, I can proceed with the RFC or something. Thank you for your patience so far. On Tue, Nov 29, 2022 at 11:43 AM Jakub Zelenka wrote: > > On Mon, Nov 28, 2022 at 4:13 PM Derick Rethans wrote: >> >> On Fri, 21 Oct 2022, Mikhail Galanin via internals wrote: >> > Looking into the future, probably we would like to have this format >> > configurable, if so it looks easy to do but still I can't see an easy >> > way to handle the microseconds issue. >> >> Making things configurable requires an ini setting, which we generally >> don't like to add. It wouldn't really work in this situation, as >> warnings/errors happen either before or during INI file parsing, meaning >> that it can't (yet) use the new format. >> > > I'm not sure I understand this because error_log itself is already config= urable using INI so obviously if the file path is specified there, then the= logged time format should be the same if configured in ini. By default the= re is no error log so errors that happen before should not be logged anyway= . Or do I miss anything? > >> >> > Could you please help me to find the right way and share your thoughts >> > about this topic (maybe there are strong objections against such a >> > change)? >> >> I don't think we should change anything in PHP. Instead, use your >> system's syslog. You can configure PHP to send all warnings to syslog by >> setting "log_errors=3D1 error_log=3Dsyslog" in PHP.ini. In order to sepa= rate >> out just the PHP issues, you can also set "syslog.facility=3Dlocal1" (or >> any other local). >> >> On Unix systems, you can configure syslog to add milliseconds to the log >> file messages. See https://askubuntu.com/a/1266114 >> >> If your system already uses systemd and journald, then you don't have to >> use any configuration settings, and you can query the journal with: >> >> journalctl -o short-iso-precise -r --facility=3Dlocal1 >> >> A PHP warning would show up in there, with something like: >> >> $ sudo journalctl -o short-iso-precise -r --facility=3Dlocal1 >> 2022-11-28T16:06:53.862980+0000 gargleblaster php[3143059]: PHP Warning:= Undefined variable $fasd in Command line code on line 1 >> > > It is not always practical to use system log for PHP especially for users= using more than one FPM pool. Log files also offer some advantages like ea= sier export and post processing so I think there is still place for log fil= es and we should support the users that still use them which includes new f= eatures like this one. > > Cheers > > Jakub