国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? PHP ????? Swoole ?? ??? ?? Hyperf ?????? ???? ??

?? ??? ?? Hyperf ?????? ???? ??

Oct 25, 2023 am 09:15 AM
???? ?? ?? ???? ?????

?? ??? ?? Hyperf ?????? ???? ??

?? ??? ?? Hyperf ?????? ???? ??

??: Hyrpf? ??? ?? ??? ??? ?? PHP ?? ??? ???, ?? ??? ??? ????????. ?? ??? ?? ????? ???? ?????. ? ????? ?? ??? ?? Hyperf ?????? ???? ??? ???? ?? ?? ??? ?????.

1. Hyperf ????? ??

?? Hyperf ?????? ???? ???. Composer? ?? ??? ? ????. ??? ??? ?? ?? ??? ?????:

composer create-project hyperf/hyperf

2. ?? ?? ??

Hyperf ??????? ?? ??? ?? ??? /config/? ?????. autoload/logging.php ??? ???? ?? ?? ??, ?? ?? ? ?? ??? ??? ??? ? ????. ??? ??? ?? ?? ?????. /config/autoload/logging.php文件中,我們可以在該文件中設(shè)置日志存儲(chǔ)的路徑、日志級(jí)別等信息。以下是一個(gè)簡(jiǎn)單的日志配置示例:

return [
    'default' => [
        'handler' => [
            'class' => MonologHandlerStreamHandler::class,
            'formatter' => env('LOG_CHAN_EN', MonologFormatterLineFormatter::class),
            'path' => BASE_PATH . '/runtime/logs/hyperf.log',
            'level' => MonologLogger::INFO,
        ],
    ],
];

其中,path字段表示日志存放的路徑。在這個(gè)示例中,我們將日志存放在/runtime/logs/hyperf.log文件中。

三、使用日志記錄功能

在Hyperf框架中,我們可以通過依賴注入的方式來(lái)使用日志記錄的功能。以下是一個(gè)簡(jiǎn)單的使用示例:

use HyperfLoggerLoggerFactory;

class FooService
{
    /**
     * @var PsrLogLoggerInterface
     */
    private $logger;

    public function __construct(LoggerFactory $loggerFactory)
    {
        $this->logger = $loggerFactory->get('default');
    }

    public function doSomething()
    {
        // 省略業(yè)務(wù)邏輯

        $this->logger->info('Something happened');
    }
}

在上面的示例中,我們通過依賴注入的方式將LoggerFactory類注入到FooService類中。然后,我們可以通過$this->logger->info()方法來(lái)記錄日志。

四、使用日志通道

在Hyperf框架中,日志可以分為多個(gè)通道,每個(gè)通道可以有自己的配置和處理方式。以下是一個(gè)示例:

use HyperfLoggerLoggerFactory;
use MonologFormatterJsonFormatter;

class BarService
{
    /**
     * @var PsrLogLoggerInterface
     */
    private $logger;

    public function __construct(LoggerFactory $loggerFactory)
    {
        $this->logger = $loggerFactory->get('default');
    }

    public function doSomething()
    {
        // 省略業(yè)務(wù)邏輯

        $context = [
            'foo' => 'bar',
        ];

        $this->logger->channel('foo')->pushHandler(function ($record) use ($context) {
            $record['context'] = $context;
        })->info('Something happened');
    }
}

在上面的示例中,我們使用$this->logger->channel('foo')來(lái)指定日志通道為'foo'。然后,我們通過pushHandler()方法設(shè)置了一個(gè)處理器函數(shù),將上下文信息$context添加到日志記錄中。

五、使用自定義日志處理器

在Hyperf框架中,我們可以使用自定義的日志處理器來(lái)對(duì)日志進(jìn)行處理。以下是一個(gè)示例:

use HyperfLoggerLoggerFactory;
use MonologFormatterJsonFormatter;
use MonologHandlerRedisHandler;

class BazService
{
    /**
     * @var PsrLogLoggerInterface
     */
    private $logger;

    public function __construct(LoggerFactory $loggerFactory)
    {
        $this->logger = $loggerFactory->get('default');
    }

    public function doSomething()
    {
        // 省略業(yè)務(wù)邏輯

        $redisHandler = new RedisHandler(/* redis 配置 */);
        $redisHandler->setFormatter(new JsonFormatter());

        $this->logger->pushHandler($redisHandler)->info('Something happened');
    }
}

在上面的示例中,我們創(chuàng)建了一個(gè)RedisHandler對(duì)象,并設(shè)置了相應(yīng)的配置和格式化方式。然后,我們通過pushHandler()rrreee

? ? path ??? ??? ???? ??? ?????. ? ???? /runtime/logs/hyperf.log ??? ??? ?????.

3. ?? ?? ??

Hyperf ???????? ??? ??? ?? ?? ??? ??? ? ????. ??? ??? ?? ????.

rrreee

? ???? ??? ??? ?? FooService ???? LoggerFactory ???? ?????. ?? ?? $this->logger->info() ???? ?? ??? ??? ? ????. ????4. ?? ?? ??????Hyperf ???????? ??? ?? ??? ?? ? ??? ? ??? ??? ?? ? ?? ??? ?? ? ????. ?? ??? ????. ??rrreee??? ???? $this->logger->channel('foo')? ???? ?? ??? 'foo'? ?????. ?? ?? pushHandler() ???? ?? ??? ??? ???? ?? ???? ???? ?? $context? ?????. ????5. ??? ?? ?? ???? ??????Hyperf ???????? ??? ?? ?? ????? ???? ??? ??? ? ????. ??? ?????. ??rrreee??? ????? RedisHandler ??? ???? ?? ?? ? ?? ?? ??? ??????. ?? ?? pushHandler() ???? ?? ??? ???? ?????. ??????:????? ???? ?? ??? ?? Hyperf ?????? ???? ??? ?????. ?? ?? ??, ?? ?? ??, ?? ?? ? ??? ?? ?? ????? ???? ?? ?? ? ??? ?????. Hyperf ?????? ???? ??? ?? ?? ???? ??? ??? ? ??? ??? ??? ?? ?? ??? ??? ? ????. ? ?? ?? ??? ?? Hyperf ?????? ??? ? ??? ??? ????. ??????: ?? ?? ??? ???? ??? ???? ??? ???? ??? ?? ?? ? ????? ???. ??

? ??? ?? ??? ?? Hyperf ?????? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

?? ????
1744
16
Cakephp ????
1596
56
??? ????
1537
28
PHP ????
1396
31
???
DirectX ?? ??? ???? ??? ?????? DirectX ?? ??? ??? ??? DirectX ?? ??? ???? ??? ?????? DirectX ?? ??? ??? ??? Mar 15, 2024 am 08:31 AM

DirectX ?? ??? ?? ???? DirectX ??? ???? ?? ??? ???, ??? ???? ?? ??? ? ????. DirectX ?? ??? ???? ??? ??? ???? ?? ? ????. ??? ??? ????? ???????. 1. ?? ?? ?????? ???? ?? ??? ?????. 2. ??? ??? ? C++ ?? ??? ????? ??? ??? ???? ???? ?? ??? ??? ? ?? ?? ???? ?????. 3. ?? ??? ???? ??? ??? ? ?? ?? ??? ?????. 4. ??? ??? ? ?? ???? ?????. 5. ?? ?? ??? ??? ??? ??? ??? ???? ??? ??? ??? ????? ???? ?? ??? ? ? ????.

HTTP 525 ?? ?? ??: ?? ? ?? ???? HTTP 525 ?? ?? ??: ?? ? ?? ???? Feb 18, 2024 pm 10:12 PM

HTTP 525 ?? ?? ??: ?? ? ??? ?? HTTP(HypertextTransferProtocol) 525 ?? ??? SSL ????? ???? ?? ??? ??? ???? ?? ??? ??? ? ??? ?????. TLS(?? ?? ??) ????? ?? ??? ???? ??? ? ?? ??? ?????. ? ?? ??? ?? ?? ??? ??? ????? ?? ?? ?? ?? ??? ?????. ?????? HTTPS? ?? ??? ??? ???? ???? ?? ?? ????.

????? ??? - ????? ??? ????? ??? - ????? ??? Mar 04, 2024 pm 06:10 PM

?????? ?? ??? ??? ???????, ??? ?? ???? ????? ???? ??? ????. ??? ?? ??? ??? ???? ?? ???? ????? ???? ??? ???????. 1. PotPlayer ??? PotPlayer ????? ?? ?? ???? ??? ????. (1) ??/?? ??: ???? (2) ??: ??? ?, ?? ??? ? (3) ???/??: ?? ? ??? ??? ? (4) ???: P-??? ??, H-View ??? (5) ????/??: Enter (6) ??: C-??, 7) ??/?? ???: D/

KMS ??? ??? ?????? KMS ??? ??? ???? ??? ?????? KMS ??? ??? ???? ??? ?????? KMS ??? ??? ?????? KMS ??? ??? ???? ??? ?????? KMS ??? ??? ???? ??? ?????? Mar 18, 2024 am 11:07 AM

KMS ?? ?? ??? Microsoft Windows ? Office ??? ?? ???? ? ???? ????? ?????. KMS? KeyManagementService? ??? ? ?? ??????. KMS ?? ?? ??? ???? ?? KMS ??? ???? Windows ? Office ??? ?? ??? ? ??? KMS ??? ??? ????????. KMS ??? ??? ??? ?? ??? ?????. ? ?? ???? ????? ???? ? ???, ???? ???? ??? ?? ??? Windows ???? Office ?????? ???? ? ????. ??? ?? ?????? Windows ?? ?? ??? ???????. KMS ?? ?? ??? ???????.

??? ???? ???-??? ???? ??? ??? ???? ???-??? ???? ??? Mar 04, 2024 pm 09:28 PM

??? Baidu Netdisk ???? ??? ???? ???? ???? ???? Baidu Netdisk ???? ??? ??????. ???? ??? ???? ????? ??? ? ????. 1??: Baidu Netdisk? ??? ? ?? ??????(?? ??). 2??: ?? ?? ??? ????? ?? "? ??" ? "?? ??"? ?????(?? ??). ?? ??"? ???? ??? ??? ???? ?? ??? ? ????(?? ??). 4??: ?? ?? "??"? ??? ?? ??? ???? ???? ??? ??? ?????(?? ??). ?? ?? 1??: ?? ?? ??? ?? ? ????(?? ??). 6??: "?? ?? ??"(?? ??)?? ??? ??? ?? ?? ????. ? ??? ???? ?????.

Xiaoma win7 ??? ?? ?? ?? - Xiaoma win7 ??? ?? ?? ?? Xiaoma win7 ??? ?? ?? ?? - Xiaoma win7 ??? ?? ?? ?? Mar 04, 2024 pm 06:16 PM

?? ????? Xiaoma win7 ??? ??? ???? ??? ?????. ??? Xiaoma win7 ??? ??? ???? ??? ?? ????? ????, ?? ??? ?? ??? ?? ???? Xiaoma win7 ??? ?? ?? ??? ???? ????. ?? ??? ?? ???. ? ?? ??? ???? ???? ? "? ???"? ???? ?? ??? "??? ??"? ???? Windows ?? ?? ??? ???? ????. ? ?? ????? ???? ????? win7 ??? ??? ?????? ???? ???(???? ?? ???? ??? ? ??). ? ?? ??? Xiaoma ??? ??? ?? "Windows ?? ???"? ???? ????. ? ?? ??? ??? ????? ???? ??? ??? ???? ????. 5??: Windows ?? ?? ??? ?? ???? ???? ?? ?????? ?????.

win10 ?? ????? ???? ???? ?? ?? ??? ???? ?? win10 ?? ????? ???? ???? ?? ?? ??? ???? ?? Dec 30, 2023 pm 03:17 PM

???? ?? ????? ??? ? ??? ?????. ?? ???? ??? ??? ???? ???? ???. ??? ?? ?? ??? ?????? ??? ?? ????? ???? ???? ??? ?? ????? ???????. win10 ?? ?? ?? ????? ???? ??: 1. "Win+R"? ??? cmd? ???? "?? ????"? ???. 2. chkdsk? ???? ?? ??? ???. 3. ?? ??? ??? ??? ?? ????. "d"? ?? ?? ??? 4. ?? ?? chkdskd:/F? ?????. 5. ?? ???? ?? ??? Y? ???? ??? ? ????.

PyCharm?? ?????? ?? ?? ? ??? ??? ?? PyCharm?? ?????? ?? ?? ? ??? ??? ?? Feb 20, 2024 am 09:21 AM

PyCharm? JetBrains?? ??? ???? Python ?? ?? ??(IDE)???. Python ????? ??? ??? ??? ???? Python ??? ?? ????? ???? ??? ? ????. PyCharm? Windows, macOS, Linux? ??? ?? ?? ??? ???? ?? Python ??? ???? ???? ??? ??? ?? IDE ??? ??? ??? ? ??? ??? ????? ?? ??? ?????. ?

See all articles