作者 yangfu
@@ -3,6 +3,7 @@ ENV APP_DIR $GOPATH/src/project-20210826 @@ -3,6 +3,7 @@ ENV APP_DIR $GOPATH/src/project-20210826
3 RUN mkdir -p $APP_DIR 3 RUN mkdir -p $APP_DIR
4 WORKDIR $APP_DIR/ 4 WORKDIR $APP_DIR/
5 COPY ./pkg pkg 5 COPY ./pkg pkg
  6 +COPY ./config config
6 COPY ./go.mod go.mod 7 COPY ./go.mod go.mod
7 COPY ./go.sum go.sum 8 COPY ./go.sum go.sum
8 COPY ./main.go main.go 9 COPY ./main.go main.go
  1 +2021/09/07 01:40:08.650 [D] [hook.go:130] CREATE TABLE IF NOT EXISTS "login_access" ("login_access_id" bigserial, "account" text, "platform" text, "company_id" bigint, "organization_id" bigint, "access_token" text, "refresh_token" text, "access_expired" bigint, "refresh_expired" bigint, "created_time" timestamptz, "updated_time" timestamptz, PRIMARY KEY ("login_access_id")) null
  2 +2021/09/07 01:40:09.439 [I] [hooks.go:101] generate router from comments
  3 +2021/09/07 01:40:09.440 [I] [???:0] http server Running on http://:8083
  4 +2021/09/07 01:40:12.667 [I] [filter.go:81] http请求 [
  5 + {
  6 + "framework": "beego",
  7 + "method": "GET",
  8 + "url": "/log"
  9 + }
  10 +]
  11 +2021/09/07 01:40:12.667 [D] [filter.go:81] http请求 [
  12 + {
  13 + "framework": "beego",
  14 + "method": "GET",
  15 + "url": "/log"
  16 + }
  17 +]
  18 +2021/09/07 01:40:12.669 [D] [filter.go:81] http响应 [
  19 + {
  20 + "framework": "beego",
  21 + "method": "GET",
  22 + "outputData": null,
  23 + "url": "/log"
  24 + }
  25 +]
  26 +2021/09/07 01:40:12.669 [D] [router.go:664] | ::1| 200 | 2.412278ms| match| GET  /log r:/log
  27 +2021/09/07 01:42:14.324 [D] [hook.go:130] CREATE TABLE IF NOT EXISTS "login_access" ("login_access_id" bigserial, "account" text, "platform" text, "company_id" bigint, "organization_id" bigint, "access_token" text, "refresh_token" text, "access_expired" bigint, "refresh_expired" bigint, "created_time" timestamptz, "updated_time" timestamptz, PRIMARY KEY ("login_access_id")) null
  28 +2021/09/07 01:42:15.705 [I] [hooks.go:101] generate router from comments
  29 +2021/09/07 01:42:15.706 [I] [???:0] http server Running on http://:8083
  1 +-----BEGIN RSA PRIVATE KEY-----
  2 +MIIEpQIBAAKCAQEAy0OxRf+NheQG9epxbrudwnrzqVgqK5zCuRAkLUgaSMATVXEA
  3 +iDzJN39om+Q49MmtEk4pXGzKUyzkFJG96PA8tJq0E+bSDtSK3n+2mjZb6pChmgHw
  4 +KEX7T8ZVLqJBSrfrI4Z2BJDNEC+3wvVW3zpog1RlfKgft6NYUzNLUqE5Mxzq7lpD
  5 +eRsq+FhzM1sOeEb2dAmUlDDs+7HcR3Kj0ttKeg+hKqIottQ/H6Tq4c8deEQGnO0+
  6 +RN3CygyETbYmLuWttI/sUltulWJALIuU81Yr6uCOq5MSt2WsU8CTuhRwGXSvcQCO
  7 +FLYppYktoMDOGIBQffmJc/DdT1d35fvdpKbm+QIDAQABAoIBAQC8X7+qX2uI6gqJ
  8 +XPxC4x0RX2DxUAPE50KOv6bHUEsLoPZJ+K/Fko/oHuuTja47Lax3inhKb4gSDUhS
  9 +x754YivgNH8u8ns5wz/vc+yGflowyFj7oVAwAqslA2luDnD0Df6crcAx+wAQQCjN
  10 +RRF9T2QMUeq73BOI3Ji+gosLyN55vms2KadrwpPQwYN7qhdrerE7vPqCZeswzs1/
  11 +A5M9PVGBG+simNea5kv+tVJUdLi6ckGAB5KabyhpG779ckwzV/aZy3wIj4SvUvCd
  12 +bewH0xPHx5TqnMOXtzHgktClmL7hIYxy9sL14Dn0KVHbyolQ7IqmJtjXYqG84Fmx
  13 +AfyDfeABAoGBAPP820tKElrfTuZ+Z19kJBTp6I5iax2Ph10glUHLlLqJ82clI/Gl
  14 +CbMtnGmD72HfnJei82xqoVLsUkN9Sp+TSNJALh4N8rHkAtwq5kWToiAWZydwxVsp
  15 +x5OWEN3+QFIdjVW6fhg6jZSK5HHIqMdZ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DVBzJ0RHfxBdiSprhTEUxOipakyA
  102 +vGp4z7h/jnZymQyd/teRCBaho1+V
  103 +-----END CERTIFICATE-----
@@ -91,14 +91,16 @@ spec: @@ -91,14 +91,16 @@ spec:
91 value: "" 91 value: ""
92 - name: LOG_LEVEL 92 - name: LOG_LEVEL
93 value: "debug" 93 value: "debug"
  94 + - name: LOG_FRAMEWORK
  95 + value: "beego"
94 - name: LOG_TYPE 96 - name: LOG_TYPE
95 - value: file 97 + value: "file"
96 - name: ERROR_BASE_CODE 98 - name: ERROR_BASE_CODE
97 value: "1" 99 value: "1"
98 - name: ERROR_BASE_CODE_MULTIPLE 100 - name: ERROR_BASE_CODE_MULTIPLE
99 value: "1000" 101 value: "1000"
100 - name: ENABLE_KAFKA_LOG 102 - name: ENABLE_KAFKA_LOG
101 - value: "true" 103 + value: "false"
102 - name: HTTP_PORT 104 - name: HTTP_PORT
103 value: "8082" 105 value: "8082"
104 - name: ALLIED_CREATION_USER_HOST 106 - name: ALLIED_CREATION_USER_HOST
  1 +apiVersion: v1
  2 +kind: Service
  3 +metadata:
  4 + name: allied-creation-gateway
  5 + namespace: mmm-suplus-test
  6 + labels:
  7 + k8s-app: allied-creation-gateway
  8 +spec:
  9 + ports:
  10 + - name: "http"
  11 + port: 80
  12 + targetPort: 8082
  13 + - name: "https"
  14 + port: 443
  15 + targetPort: 443
  16 + selector:
  17 + k8s-app: allied-creation-gateway
  18 +---
  19 +apiVersion: extensions/v1beta1
  20 +kind: Deployment
  21 +metadata:
  22 + name: allied-creation-gateway
  23 + namespace: mmm-suplus-test
  24 + labels:
  25 + k8s-app: allied-creation-gateway
  26 +spec:
  27 + replicas: 1
  28 + template:
  29 + metadata:
  30 + labels:
  31 + k8s-app: allied-creation-gateway
  32 + spec:
  33 + affinity:
  34 + nodeAffinity:
  35 + preferredDuringSchedulingIgnoredDuringExecution:
  36 + - preference: {}
  37 + weight: 100
  38 + requiredDuringSchedulingIgnoredDuringExecution:
  39 + nodeSelectorTerms:
  40 + - matchExpressions:
  41 + - key: kubernetes.io/hostname
  42 + operator: In
  43 + values:
  44 + - cn-hangzhou.i-bp1djh1xn7taumbue1ze
  45 + - cn-hangzhou.i-bp1djh1xn7taumbue1zd
  46 + - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
  47 + - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
  48 + containers:
  49 + - name: allied-creation-gateway
  50 + image: 192.168.0.243:5000/mmm/allied-creation-gateway:dev
  51 + imagePullPolicy: Always
  52 + ports:
  53 + - containerPort: 8082
  54 + - containerPort: 443
  55 + volumeMounts:
  56 + - mountPath: /opt/logs
  57 + name: accesslogs
  58 + env:
  59 + - name: POSTGRESQL_DB_NAME
  60 + valueFrom:
  61 + configMapKeyRef:
  62 + name: suplus-config
  63 + key: postgresqlalliedcreation.dbname
  64 + - name: POSTGRESQL_USER
  65 + valueFrom:
  66 + configMapKeyRef:
  67 + name: suplus-config
  68 + key: postgresql.user
  69 + - name: POSTGRESQL_PASSWORD
  70 + valueFrom:
  71 + configMapKeyRef:
  72 + name: suplus-config
  73 + key: postgresql.password
  74 + - name: POSTGRESQL_HOST
  75 + valueFrom:
  76 + configMapKeyRef:
  77 + name: suplus-config
  78 + key: postgresql.host
  79 + - name: POSTGRESQL_PORT
  80 + valueFrom:
  81 + configMapKeyRef:
  82 + name: suplus-config
  83 + key: postgresql.port
  84 + - name: REDIS_HOST
  85 + valueFrom:
  86 + configMapKeyRef:
  87 + name: suplus-config
  88 + key: redis.ip
  89 + - name: REDIS_PORT
  90 + valueFrom:
  91 + configMapKeyRef:
  92 + name: suplus-config
  93 + key: redis.port
  94 + - name: REDIS_AUTH
  95 + value: ""
  96 + - name: LOG_LEVEL
  97 + value: "debug"
  98 + - name: LOG_FRAMEWORK
  99 + value: "beego"
  100 + - name: LOG_TYPE
  101 + value: "file"
  102 + - name: ERROR_BASE_CODE
  103 + value: "1"
  104 + - name: ERROR_BASE_CODE_MULTIPLE
  105 + value: "1000"
  106 + - name: ENABLE_KAFKA_LOG
  107 + value: "false"
  108 + - name: HTTP_PORT
  109 + value: "8082"
  110 + - name: ALLIED_CREATION_USER_HOST
  111 + value: "https://allied-creation-user-test.fjmaimaimai.com"
  112 + - name: ALLIED_CREATION_COOPERATION_HOST
  113 + value: "https://allied-creation-cooperation-test.fjmaimaimai.com"
  114 + - name: ALLIED_CREATION_BASIC_HOST
  115 + value: "https://allied-creation-basic-test.fjmaimaimai.com"
  116 + - name: SMS_SERVE_HOST
  117 + value: "https://sms.fjmaimaimai.com:9897"
  118 + # - name: REDIS_HOST
  119 + # valueFrom:
  120 + # configMapKeyRef:
  121 + # name: suplus-config
  122 + # key: redis.ip
  123 + # - name: REDIS_PORT
  124 + # valueFrom:
  125 + # configMapKeyRef:
  126 + # name: suplus-config
  127 + # key: redis.port
  128 + volumes:
  129 + - name: accesslogs
  130 + emptyDir: {}
  1 +#!/bin/bash
  2 +export PATH=/root/local/bin:$PATH
  3 +kubectl -n mmm-suplus-test get pods | grep -q allied-creation-gateway
  4 +if [ "$?" == "1" ];then
  5 + kubectl create -f /tmp/test/allied-creation-gateway/allied-creation-gateway.yaml --record
  6 + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-gateway
  7 + if [ "$?" == "0" ];then
  8 + echo "allied-creation-gateway service install success!"
  9 + else
  10 + echo "allied-creation-gateway service install fail!"
  11 + fi
  12 + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-gateway
  13 + if [ "$?" == "0" ];then
  14 + echo "allied-creation-gateway deployment install success!"
  15 + else
  16 + echo "allied-creation-gateway deployment install fail!"
  17 + fi
  18 +else
  19 + kubectl delete -f /tmp/test/allied-creation-gateway/allied-creation-gateway.yaml
  20 + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-gateway
  21 + while [ "$?" == "0" ]
  22 + do
  23 + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-gateway
  24 + done
  25 + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-gateway
  26 + while [ "$?" == "0" ]
  27 + do
  28 + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-gateway
  29 + done
  30 + kubectl create -f /tmp/test/allied-creation-gateway/allied-creation-gateway.yaml --record
  31 + kubectl -n mmm-suplus-test get svc | grep -q allied-creation-gateway
  32 + if [ "$?" == "0" ];then
  33 + echo "allied-creation-gateway service update success!"
  34 + else
  35 + echo "allied-creation-gateway service update fail!"
  36 + fi
  37 + kubectl -n mmm-suplus-test get pods | grep -q allied-creation-gateway
  38 + if [ "$?" == "0" ];then
  39 + echo "allied-creation-gateway deployment update success!"
  40 + else
  41 + echo "allied-creation-gateway deployment update fail!"
  42 + fi
  43 +fi
@@ -48,6 +48,7 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 @@ -48,6 +48,7 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1
48 github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= 48 github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
49 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= 49 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
50 github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= 50 github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
  51 +github.com/elastic/go-elasticsearch/v6 v6.8.5 h1:U2HtkBseC1FNBmDr0TR2tKltL6FxoY+niDAlj5M8TK8=
51 github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= 52 github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
52 github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= 53 github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
53 github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= 54 github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
@@ -27,6 +27,7 @@ func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackC @@ -27,6 +27,7 @@ func (srv UndertakerFeedbackService) SearchFeedback(cmd *command.SearchFeedbackC
27 result.Grid.List[i].ContractUndertaker.UserCode = v.ContractUndertaker.UserInfo.UserCode 27 result.Grid.List[i].ContractUndertaker.UserCode = v.ContractUndertaker.UserInfo.UserCode
28 result.Grid.List[i].ContractUndertaker.UserName = v.ContractUndertaker.UserInfo.UserName 28 result.Grid.List[i].ContractUndertaker.UserName = v.ContractUndertaker.UserInfo.UserName
29 result.Grid.List[i].ContractUndertaker.UserPhone = v.ContractUndertaker.UserInfo.UserPhone 29 result.Grid.List[i].ContractUndertaker.UserPhone = v.ContractUndertaker.UserInfo.UserPhone
  30 + result.Grid.List[i].CooperationMode.CooperationModeName = v.CooperationModeName
30 } 31 }
31 return result, nil 32 return result, nil
32 } 33 }
@@ -8,8 +8,11 @@ import ( @@ -8,8 +8,11 @@ import (
8 const SERVICE_NAME = "allied-creation-gateway" 8 const SERVICE_NAME = "allied-creation-gateway"
9 9
10 var LOG_LEVEL = "debug" 10 var LOG_LEVEL = "debug"
11 -var LOG_TYPE = "console" 11 +var LOG_TYPE = "console"// file, console, es
  12 +var LOG_FRAMEWORK = "beego" // beego logrus
12 var LOG_FILE = "app.log" 13 var LOG_FILE = "app.log"
  14 +var LOG_PREFIX = "[allied-creation-gateway]"
  15 +
13 var HTTP_PORT int = 8083 16 var HTTP_PORT int = 8083
14 17
15 //天联共创基础模块 18 //天联共创基础模块
@@ -19,6 +19,10 @@ func init() { @@ -19,6 +19,10 @@ func init() {
19 // POSTGRESQL_PORT = os.Getenv("TOPIC_LOG_STASH") 19 // POSTGRESQL_PORT = os.Getenv("TOPIC_LOG_STASH")
20 //} 20 //}
21 if os.Getenv("ENABLE_KAFKA_LOG") != "" { 21 if os.Getenv("ENABLE_KAFKA_LOG") != "" {
22 - ENABLE_KAFKA_LOG = true 22 + if os.Getenv("ENABLE_KAFKA_LOG") == "true" {
  23 + ENABLE_KAFKA_LOG = true
  24 + } else if os.Getenv("ENABLE_KAFKA_LOG") == "false" {
  25 + ENABLE_KAFKA_LOG = false
  26 + }
23 } 27 }
24 } 28 }
@@ -81,6 +81,9 @@ type ( @@ -81,6 +81,9 @@ type (
81 CreatedAt jtime.TimeToUnixMsec `json:"createdAt"` 81 CreatedAt jtime.TimeToUnixMsec `json:"createdAt"`
82 // 共创模式名称 82 // 共创模式名称
83 CooperationModeName string `json:"cooperationModeName"` 83 CooperationModeName string `json:"cooperationModeName"`
  84 + CooperationMode struct {
  85 + CooperationModeName string `json:"cooperationModeName"`
  86 + } `json:"cooperationMode"`
84 } `json:"list"` 87 } `json:"list"`
85 Total int `json:"total"` 88 Total int `json:"total"`
86 } `json:"grid"` 89 } `json:"grid"`
@@ -4,12 +4,11 @@ import ( @@ -4,12 +4,11 @@ import (
4 "bytes" 4 "bytes"
5 "encoding/json" 5 "encoding/json"
6 "fmt" 6 "fmt"
7 - "io"  
8 - "strconv"  
9 -  
10 "github.com/beego/beego/v2/core/logs" 7 "github.com/beego/beego/v2/core/logs"
11 - "github.com/linmadan/egglib-go/log" 8 + _ "github.com/beego/beego/v2/core/logs/es"
12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
  10 + "io"
  11 + "strconv"
13 ) 12 )
14 13
15 type LoggerConfig struct { 14 type LoggerConfig struct {
@@ -26,35 +25,7 @@ type BeegoLog struct { @@ -26,35 +25,7 @@ type BeegoLog struct {
26 beeLogger *logs.BeeLogger 25 beeLogger *logs.BeeLogger
27 } 26 }
28 27
29 -var _ log.Logger = &BeegoLog{}  
30 -  
31 -func NewBeegoLog(conf LoggerConfig) *BeegoLog {  
32 - logger := logs.GetBeeLogger()  
33 - logger.SetLevel(conf.Level)  
34 - if constant.LOG_TYPE == "file" { // 日志存储到文件  
35 - confByte, _ := json.Marshal(conf)  
36 - err := logger.SetLogger(logs.AdapterFile, string(confByte))  
37 - if err != nil {  
38 - fmt.Println(err.Error())  
39 - return nil  
40 - }  
41 - } else { // 日志输出到控制台  
42 - err := logger.SetLogger(logs.AdapterConsole, `{"level":7,"color":true}`)  
43 - if err != nil {  
44 - fmt.Println(err.Error())  
45 - return nil  
46 - }  
47 - }  
48 - logger.SetPrefix(constant.SERVICE_NAME)  
49 - logger.EnableFuncCallDepth(true)  
50 - logger.SetLogFuncCallDepth(5)  
51 - return &BeegoLog{  
52 - beeLogger: logger,  
53 - }  
54 -}  
55 -  
56 func (logger *BeegoLog) AddHook(write io.Writer) { 28 func (logger *BeegoLog) AddHook(write io.Writer) {
57 -  
58 } 29 }
59 30
60 func (logger *BeegoLog) SetServiceName(serviceName string) { 31 func (logger *BeegoLog) SetServiceName(serviceName string) {
@@ -118,3 +89,35 @@ func (logger *BeegoLog) Fatal(msg string, appends ...map[string]interface{}) { @@ -118,3 +89,35 @@ func (logger *BeegoLog) Fatal(msg string, appends ...map[string]interface{}) {
118 func (logger *BeegoLog) Panic(msg string, appends ...map[string]interface{}) { 89 func (logger *BeegoLog) Panic(msg string, appends ...map[string]interface{}) {
119 logs.Error(msg, appends) 90 logs.Error(msg, appends)
120 } 91 }
  92 +
  93 +func NewBeegoLog(conf LoggerConfig) *BeegoLog {
  94 + logger := logs.GetBeeLogger()
  95 + logger.SetLevel(conf.Level)
  96 + if constant.LOG_TYPE == "file" { // 日志存储到文件
  97 + confByte, _ := json.Marshal(conf)
  98 + err := logger.SetLogger(logs.AdapterFile, string(confByte))
  99 + if err != nil {
  100 + fmt.Println(err.Error())
  101 + return nil
  102 + }
  103 + } else if constant.LOG_TYPE == "es" { // 日志存储到ES
  104 + err := logger.SetLogger(logs.AdapterEs, `{"dsn":"http://192.168.100.222:9200/","level":7}`)
  105 + if err != nil {
  106 + fmt.Println(err.Error())
  107 + return nil
  108 + }
  109 + } else { // 日志输出到控制台
  110 + err := logger.SetLogger(logs.AdapterConsole, `{"level":7,"color":true}`)
  111 + if err != nil {
  112 + fmt.Println(err.Error())
  113 + return nil
  114 + }
  115 + }
  116 + logger.SetPrefix(constant.LOG_PREFIX)
  117 + logger.EnableFuncCallDepth(true)
  118 + logger.SetLogFuncCallDepth(5)
  119 + logger.SetPrefix(constant.LOG_PREFIX)
  120 + return &BeegoLog{
  121 + beeLogger: logger,
  122 + }
  123 +}
1 package log 1 package log
2 2
3 import ( 3 import (
  4 + "github.com/linmadan/egglib-go/log/logrus"
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
5 6
6 "github.com/linmadan/egglib-go/log" 7 "github.com/linmadan/egglib-go/log"
@@ -9,13 +10,15 @@ import ( @@ -9,13 +10,15 @@ import (
9 var Logger log.Logger 10 var Logger log.Logger
10 11
11 func init() { 12 func init() {
12 - // Logger = logrus.NewLogrusLogger()  
13 - // Logger.SetServiceName(constant.SERVICE_NAME)  
14 - // Logger.SetLevel(constant.LOG_LEVEL)  
15 - // //  
16 - Logger = NewBeegoLog(LoggerConfig{  
17 - Filename: constant.LOG_FILE,  
18 - Level: 7,  
19 - MaxSize: 1024 * 1024 * 2,  
20 - }) 13 + if constant.LOG_FRAMEWORK == "beego" {
  14 + Logger = NewBeegoLog(LoggerConfig{
  15 + Filename: constant.LOG_FILE,
  16 + Level: 7,
  17 + MaxSize: 1024 * 1024 * 2,
  18 + })
  19 + } else if constant.LOG_FRAMEWORK == "logrus" {
  20 + Logger = logrus.NewLogrusLogger()
  21 + Logger.SetServiceName(constant.SERVICE_NAME)
  22 + Logger.SetLevel(constant.LOG_LEVEL)
  23 + }
21 } 24 }
@@ -33,10 +33,10 @@ func init() { @@ -33,10 +33,10 @@ func init() {
33 } 33 }
34 } 34 }
35 //https支持 35 //https支持
36 - web.BConfig.Listen.EnableHTTPS = false  
37 - web.BConfig.Listen.HTTPSPort = 80  
38 - web.BConfig.Listen.HTTPSCertFile = ""  
39 - web.BConfig.Listen.HTTPSKeyFile = "" 36 + web.BConfig.Listen.EnableHTTPS = true
  37 + web.BConfig.Listen.HTTPSPort = 443
  38 + web.BConfig.Listen.HTTPSCertFile = "./config/fjmaimaimai.com_bundle.crt"
  39 + web.BConfig.Listen.HTTPSKeyFile = "./config/fjmaimaimai.com.key"
40 40
41 filters.SecureKeyMap["token"] = "x-mmm-accesstoken" 41 filters.SecureKeyMap["token"] = "x-mmm-accesstoken"
42 web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors()) 42 web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors())
  1 +package controllers
  2 +
  3 +import "io/ioutil"
  4 +
  5 +type LoggerController struct {
  6 + BaseController
  7 +}
  8 +
  9 +func (controller LoggerController) Index() {
  10 + bytes, _ := ioutil.ReadFile("./app.log")
  11 + controller.Ctx.WriteString(string(bytes))
  12 +}
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/log", &controllers.LoggerController{}, "Get:Index")
  10 +}