国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

當(dāng)使用自定義進(jìn)程,如果使用日志實(shí)例,導(dǎo)致日志時(shí)區(qū)錯(cuò)誤

xiaoming

問題描述

單例模式導(dǎo)致

程序代碼或配置

if ($timezone = config('app.default_timezone')) {
   date_default_timezone_set($timezone);
}

執(zhí)行晚于

\support\Log::channel('default')
$this->timezone = $timezone ?: new DateTimeZone(date_default_timezone_get() ?: 'UTC');
667 3 0
3個(gè)回答

xiaoming

@walkor 老大麻煩看下

  • 暫無評(píng)論
walkor 打賞

沒有人反饋過這個(gè)問題,本地測(cè)試正常。
請(qǐng)發(fā)一個(gè)精簡(jiǎn)的能重現(xiàn)你問題的例子代碼。

  • xiaoming 2024-10-23

    如果 php.ini 設(shè)置date.timezone = "Asia/Shanghai" 是正常 但如果是php.ini 是utc 則是不正常的

xiaoming

配置

<?php
//process.php

'task' => [
        'handler' => \Webman\App::class,
        'listen' => 'http://0.0.0.0:8686',
        'count' => 8, // 進(jìn)程數(shù)
        'user' => '',
        'group' => '',
        'reusePort' => true,
        'constructor' => [
            'requestClass' => \support\Request::class, // request類設(shè)置
            'logger' => \support\Log::channel('default'), // 日志實(shí)例
            'appPath' => app_path(), // app目錄位置
            'publicPath' => public_path() // public目錄位置
        ]
    ]

打印日志

應(yīng)該是 2024-10-23 21:xx:xx

[2024-10-23 13:50:59] default.INFO: hello [] []
[2024-10-23 13:54:30] default.INFO: hello [] []
  • walkor 2024-10-24

    好吧,原來是自定義http進(jìn)程。下個(gè)版本修復(fù)。

??