monolog升级到3.5,mongodb升级到7.0,mongodb添加用户名密码,修复php代码中的bug
This commit is contained in:
parent
53a189b1ef
commit
8effbfaa05
@ -49,12 +49,12 @@ SQLITE_DATABASE = "base_path() . '/database.sqlite'"
|
||||
SQLITE_PREFIX =
|
||||
|
||||
# mongolog: mongodb记录日志
|
||||
MONGOLOG_URL = mongodb://127.0.0.1:27019
|
||||
MONGOLOG_URL = mongodb://root:password@127.0.0.1:27019
|
||||
MONGOLOG_HOST = 127.0.0.1
|
||||
MONGOLOG_PORT = 27019
|
||||
MONGOLOG_DATABASE = log
|
||||
MONGOLOG_USERNAME =
|
||||
MONGOLOG_PASSWORD =
|
||||
MONGOLOG_USERNAME = root
|
||||
MONGOLOG_PASSWORD = password
|
||||
|
||||
# log
|
||||
LOG_MAX_FIlES = 30
|
||||
|
@ -13,13 +13,13 @@ class TestController
|
||||
public function index(Request $request)
|
||||
{
|
||||
$res = Container::make(Res::class);
|
||||
// Log::channel('default')->info(__CLASS__ . DIRECTORY_SEPARATOR . __FUNCTION__, $_SERVER);
|
||||
$logs = Db::connection('mongolog')->collection('request')->get();
|
||||
// foreach ($logs as $log) {
|
||||
// $log->delete();
|
||||
// }
|
||||
// $logs->delete();
|
||||
$res->setData($logs);
|
||||
Log::channel('default')->info(__CLASS__ . DIRECTORY_SEPARATOR . __FUNCTION__, $request->all());
|
||||
$requestLogs = Db::connection('mongolog')->collection('request')->get();
|
||||
$defaultLogs = Db::connection('mongolog')->collection('default')->get();
|
||||
$res->setData([
|
||||
'request' => $requestLogs,
|
||||
'default' => $defaultLogs,
|
||||
]);
|
||||
return json($res);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ class RequestLog implements MiddlewareInterface
|
||||
* @var array
|
||||
*/
|
||||
protected $actionWhiteList = [
|
||||
'app\controller\testcontroller\index', // oss里的download不校验
|
||||
'app\controller\testcontroller\index',
|
||||
];
|
||||
|
||||
public function process(Request $request, callable $next) : Response
|
||||
|
@ -26,7 +26,7 @@
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"workerman/webman-framework": "^1.5.0",
|
||||
"monolog/monolog": "^3.0",
|
||||
"monolog/monolog": "^3.5",
|
||||
"vlucas/phpdotenv": "^5.5",
|
||||
"illuminate/database": "^10.0",
|
||||
"illuminate/pagination": "^10.0",
|
||||
|
2
api/composer.lock
generated
2
api/composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b60184ef23f8e71843aa7695eed31518",
|
||||
"content-hash": "39ff7b274d51d63c430e0f1f75ef26f0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
|
@ -1,6 +1,21 @@
|
||||
version: "3.1"
|
||||
|
||||
services:
|
||||
|
||||
log:
|
||||
image: mongo:7.0
|
||||
container_name: webman-jsonrpc-log
|
||||
restart: always
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: password
|
||||
MONGO_INITDB_DATABASE: log
|
||||
volumes:
|
||||
- ./log/db:/data/db
|
||||
- ./log/mongod.conf:/etc/mongod.conf
|
||||
network_mode: host
|
||||
command: ['mongod', '--config', '/etc/mongod.conf']
|
||||
|
||||
api:
|
||||
image: wandoubaba517/workerman:8.1
|
||||
container_name: webman-jsonrpc-api
|
||||
@ -14,13 +29,3 @@ services:
|
||||
depends_on:
|
||||
- log
|
||||
command: ['php', 'start.php', 'start']
|
||||
|
||||
log:
|
||||
image: mongo:6.0
|
||||
container_name: webman-jsonrpc-log
|
||||
restart: always
|
||||
volumes:
|
||||
- ./log/db:/data/db
|
||||
- ./log/mongod.conf:/etc/mongod.conf
|
||||
network_mode: host
|
||||
command: ['mongod', '--config', '/etc/mongod.conf']
|
||||
|
Loading…
Reference in New Issue
Block a user