{{wikiTitle}}
config配置文件
复制链接
编辑文档
目录结构
├─config
│ admin.php
│ app.php
│ cache.php
│ console.php
│ cookie.php
│ database.php
│ filesystem.php
│ lang.php
│ log.php
│ middleware.php
│ qrcode.php
│ queue.php
│ route.php
│ session.php
│ sms.php
│ swoole.php
│ template.php
│ trace.php
│ upload.php
│ view.php
调用配置 例如 log.php
use think\facade\Env;
// +----------------------------------------------------------------------
// | 日志设置
// +----------------------------------------------------------------------
return [
// 默认日志记录通道
'default' => Env::get('log.channel', 'file'),
// 日志记录级别
'level' => ['error','warning'],
// 日志类型记录的通道 ['error'=>'email',...]
'type_channel' => [],
// 是否关闭日志写入
'close' => false,
// 日志通道列表
'channels' => [
'file' => [
// 日志记录方式
'type' => 'File',
// 日志保存目录
'path' => app()->getRuntimePath() . 'log' . DIRECTORY_SEPARATOR,
// 单文件日志写入
'single' => false,
// 独立日志级别
'apart_level' => [],
// 最大日志文件数量
'max_files' => 0,
],
// 其它日志通道配置
],
];
获取日志通道列表 Config::get(channels); 获取日志通道文件记录方式配置,只需要将键名以"."点连接即可。 Config::get(channels.file); Config::get(channels.file.type);
配置说明:
| 配置名 | 说明 |
|---|---|
| admin | 应用后端基础共性类配置 |
| app | 应用前端、后端基础共性类配置 |
| cache | 缓存配置 |
| console | 控制台配置 |
| cookie | cookie配置 |
| database | 数据库配置 |
| filesystem | 文件磁盘配置 |
| lang | 语言配置 |
| log | 日志配置 |
| middleware | 中间件配置 |
| qrcode | 二维码配置 |
| queue | 队列配置 |
| route | 路由基础配置 |
| session | 会话配置 |
| sms | 短信配置 |
| template | 微信公众号模板消息及小程序订阅消息配置 |
| trace | Trace设置 开启调试模式后有效 |
| upload | 文件上传配置 |
| view | 渲染模板配置 |
评论({{cateWiki.comment_num}})
最新
最早
{{cateWiki.page_view_num}}人看过该文档
评论(0)
最新
最早
2577人看过
登录/注册
即可发表评论
{{item.user ? item.user.nickname : ''}}
(自评)
{{item.content}}
搜索结果
为您找到{{wikiCount}}条结果
{{item.page_view_num}}
{{item.like ? item.like.like_num : 0}}
{{item.comment ? item.comment.comment_num : 0}}
位置:
{{path.name}}
{{(i+1) == getCataloguePathData(item.catalogue).length ? '':'/'}}
