mirror of
https://github.com/gowvp/gb28181.git
synced 2025-09-26 19:41:19 +08:00
优化日志记录
This commit is contained in:
@@ -11,6 +11,8 @@ ADD ./www ./www
|
||||
# 创建配置目录
|
||||
RUN mkdir -p configs
|
||||
|
||||
RUN chown -R $USER:$USER /opt/media/bin
|
||||
|
||||
# 添加元数据标签
|
||||
LABEL Name=gowvp \
|
||||
Version=0.0.1 \
|
||||
|
@@ -111,6 +111,7 @@ services:
|
||||
# 如果拉不到 docker hub 镜像,也可以尝试
|
||||
# registry.cn-shanghai.aliyuncs.com/ixugo/homenvr:latest
|
||||
image: gospace/gowvp:latest
|
||||
restart: unless-stopped
|
||||
# linux 解开下行注释,并将 ports 全部注释
|
||||
# network_mode: host
|
||||
ports:
|
||||
@@ -129,6 +130,7 @@ services:
|
||||
- 20000-20100:20000-20100 # gb28181 收流端口
|
||||
- 20000-20100:20000-20100/udp # gb28181 收流端口udp
|
||||
volumes:
|
||||
# 日志目录是 configs/logs
|
||||
- ./data:/opt/media/bin/configs
|
||||
```
|
||||
|
||||
|
@@ -3,6 +3,7 @@ services:
|
||||
# 如果拉不到 docker hub 镜像,也可以尝试
|
||||
# registry.cn-shanghai.aliyuncs.com/ixugo/homenvr:latest
|
||||
image: gospace/gowvp:latest
|
||||
restart: unless-stopped
|
||||
# linux 解开下行注释,并将 ports 全部注释
|
||||
# network_mode: host
|
||||
ports:
|
||||
|
@@ -108,7 +108,6 @@ func setupZLM(ctx context.Context, dir string) {
|
||||
// 启动命令
|
||||
if err := cmd.Run(); err != nil {
|
||||
slog.Error("zlm 运行失败", "err", err)
|
||||
continue
|
||||
}
|
||||
time.Sleep(5 * time.Second)
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ func DefaultConfig() Bootstrap {
|
||||
},
|
||||
Log: Log{
|
||||
Dir: "./logs",
|
||||
Level: "info",
|
||||
Level: "error",
|
||||
MaxAge: Duration(7 * 24 * time.Hour),
|
||||
RotationTime: Duration(8 * time.Hour),
|
||||
RotationSize: 50,
|
||||
|
2
main.go
2
main.go
@@ -64,7 +64,7 @@ func main() {
|
||||
func configIsNotExistWrite(path string) {
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
if err := conf.WriteConfig(conf.DefaultConfig(), path); err != nil {
|
||||
system.ErrPrintf("WriteConfig", "err", err)
|
||||
system.ErrPrintf("WriteConfig err[%s]", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -288,7 +288,7 @@ func (s *Server) handlerRequest(msg *Request) {
|
||||
}
|
||||
handlers, ok := s.route.Load(strings.ToUpper(key))
|
||||
if !ok {
|
||||
slog.Error("not found handler func,string:", "method", msg.Method(), "msg", msg.String())
|
||||
slog.Debug("not found handler func", "method", msg.Method(), "msg", msg.String())
|
||||
go handlerMethodNotAllowed(msg, tx)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user