Skip to content

thinkphp6 中 log.php这里面大家是怎么配置的 #55

@m-dnxbf

Description

@m-dnxbf

`<?php

// return [
//     'type'                => 'SocketLog',
//     'host'                => 'localhost',
//     //日志强制记录到配置的client_id
//     'force_client_ids'    => [ 'abcdefg' ],
//     //限制允许读取日志的client_id
//     'allow_client_ids'    => [ 'abcdefg' ],
// ];

// +----------------------------------------------------------------------
// | 日志设置
// +----------------------------------------------------------------------

return [
// 默认日志记录通道
'default' => env( 'log.channel', 'socketlog'),
// 日志记录级别
'level' => [],
// 日志类型记录的通道 ['error'=>'email',...]
'type_channel' => [],
// 关闭全局日志写入
'close' => false,
// 全局日志处理 支持闭包
'processor' => null,

// 日志通道列表
'channels'     => [
    'file' => [
        // 日志记录方式
        'type'           => 'File',
        // 日志保存目录
        'path'           => '',
        // 单文件日志写入
        'single'         => false,
        // 独立日志级别
        'apart_level'    => [],
        // 最大日志文件数量
        'max_files'      => 0,
        // 使用JSON格式记录
        'json'           => false,
        // 日志处理
        'processor'      => null,
        // 关闭通道日志写入
        'close'          => false,
        // 日志输出格式化
        'format'         => '[%s][%s] %s',
        // 是否实时写入
        'realtime_write' => false,
    ],

    // 其它日志通道配置
    'socketlog' => [
        'type'                => 'SocketLog',
        'host'                => 'localhost',
        //日志强制记录到配置的client_id
        'force_client_ids'    => [ 'abcdefg' ],
        //限制允许读取日志的client_id
        'allow_client_ids'    => [ 'abcdefg' ],
    ],
],

];
`
我的是这样的,在网上找了很多资料,不管怎么改,就是不成功。只能来问问大家有在thinkphp6中使用成功的吗

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions