Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119032 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 26311 invoked from network); 25 Nov 2022 14:01:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Nov 2022 14:01:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A9453180504 for ; Fri, 25 Nov 2022 06:01:51 -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=-2.1 required=5.0 tests=BAYES_05,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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, 25 Nov 2022 06:01:51 -0800 (PST) Received: by mail-ed1-f53.google.com with SMTP id r26so4423249edc.10 for ; Fri, 25 Nov 2022 06:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=team.bumble.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JYbEFhCa3auqC8+vC3OcO4KqiJF/Jb+o2UlC1fQnzCU=; b=YNjKdDFRqzCMgJOORfZB5T36dmGqkZFyF2myxcBdxU4UjA6EKprMlbkN/IR6yAOVTC BrNudZWRd7hcyAMx/vSWXJ/J/7aU4R9hoVPI6KjIh3MjAw0uPpkr7eiUe3Su0DgbR77n elB6iU7YAWFS3Va9ci9IPikSoxugQwEznodYY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=JYbEFhCa3auqC8+vC3OcO4KqiJF/Jb+o2UlC1fQnzCU=; b=dbrfgOc5j+mhZVjhNzIzylZTqyC9ih+t61kkg7KJfRQwpMDfLKUYV8UQf8Sf7MGJEa LjDVmbqMNcVPKA/HkIkctJWZQfvDrnAeJT6YWokR4dxYeYj3EdAGzmY0zxfzy2AuGlLV 6OTWL/2mYwXI3gMs/dvAFtQZYrlpmbIsxgaw2NNnT3vyT59pirxJjgT/bqUHGZKDjdY8 f8p8airT8Q523Pipns6LzLqCmyllkfn53Uj/aP20F+GGxBqEqynUMMwVLtE4wOdmoZgo EPcffTtU9bZ4Ui/2YHGAjwKrrrYn9ecl3j5dZ1k1heU00S8ICLuhnYh47cNEvq3a40XQ /72A== X-Gm-Message-State: ANoB5pnvHtIbPZAoOePgGVm6ttZ781ezlh5CyiDpXZ6mJGzpVvvOG29f Ohvj0oMsP5znH9nixPJfyyY2hldSXrnty7PKemdrAA== X-Google-Smtp-Source: AA0mqf6ob47XIGoIa61+9AQnQIOSgPPe+e6kBJI4o2xG8WbsGqAOdW0sac1qCQ3HMQOn3NkAlHNXnkksOMXVde7w2Pc= X-Received: by 2002:a05:6402:e97:b0:461:beb2:76e with SMTP id h23-20020a0564020e9700b00461beb2076emr34903156eda.5.1669384900599; Fri, 25 Nov 2022 06:01:40 -0800 (PST) MIME-Version: 1.0 References: <42A5DAC6-253E-478D-808C-36690FA88315@gmail.com> <46b289c4-9255-ad66-3410-46b19fc91bf6@gmail.com> In-Reply-To: Reply-To: Mikhail Galanin Date: Fri, 25 Nov 2022 14:01:04 +0000 Message-ID: To: Craig Francis Cc: Rowan Tommins , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Microseconds to error log From: internals@lists.php.net ("Mikhail Galanin via internals") Hello good people, (really hope I'm writing into the right thread this time). I updated the patch considering the thoughts from this thread. Thank you all for being so much responsive and helpful! Meanwhile, there are two changes: * Added function `php_format_timestamp' that takes microseconds part, `php_format_date' remains unchanged to keep backward compatibility. * Added INI `error_log_usec` = on|off (off by default) that changes the timestamp. Questions I have at the moment: 1. Naming (the most difficult part of our job, yeah) - does anyone feel that they could suggest something better? Maybe someone can think up something better, more clear/consistent with other parts of the codebase? 2. The INI-thing. When initially I mentioned being configurable, I realised that it could've been perceived in many different ways: - we can enable/disable the microseconds - we can choose from a pre-defined list of formats (PHP7, PHP7 + msec, PHP7+ usec, ISO8601, ISO8601+usec, etc...) - we also might want to use an Apache/HTTPd-like approach, e.g. "[${time:format} $pid $hostname] $error_message" Or, once we enable microseconds, we can switch to the ISO format, for example (no, I don't like this approach but if we change the setting name it might be not that confusing) What do you think? On Mon, Oct 31, 2022 at 10:16 AM Craig Francis wrote: > > On Sun, 30 Oct 2022 at 17:42, Rowan Tommins wrote: > > > In case of any confusion, I think this should be configurable as > > "include microseconds: on / off", not configurable as "enter date format". > > > > > Any reason it can't be configured to use ISO 8601? > > Apache 2.4 allows you to use `LogFormat "... > [%{%Y-%m-%dT%H:%M:%S}t.%{msec_frac}t] ..." format_name` > > https://httpd.apache.org/docs/trunk/mod/mod_log_config.html > > And MySQL uses "YYYY-MM-DDThh:mm:ss.uuuuuu": > > https://dev.mysql.com/doc/refman/8.0/en/error-log-format.html#error-log-format-system-variables > > When I'm doing some quick log checking, I often forget that PHP uses a > different date format... admittedly, it can help having the month spelled > out, so no one accidentally thinks it's the American format :-) > > Craig