Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3e03aad2
authored
Oct 28, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
c19edaa8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
2 deletions
pkg/common/log_report.go
pkg/logger/mylog.go
pkg/common/log_report.go
View file @
3e03aad2
...
...
@@ -28,7 +28,6 @@ type SearchApiLog struct {
}
func
AnalyzeSearchError
(
ctx
*
gin
.
Context
,
code
int
,
ip
,
errMsg
,
file
,
line
,
method
string
)
(
log
SearchApiLog
)
{
return
//获取所有参数
request
:=
make
(
map
[
string
]
string
)
ctx
.
MultipartForm
()
...
...
@@ -83,6 +82,7 @@ func (s *LogFormatter) Format(entry *log.Entry) ([]byte, error) {
//写入到特定的文件夹给ELK使用的日志
func
WriteSearchErrorLog
(
searchLog
string
)
{
return
;
// 设置日志格式为json格式
log
.
SetFormatter
(
new
(
LogFormatter
))
path
:=
"../logs/search/"
...
...
pkg/logger/mylog.go
View file @
3e03aad2
...
...
@@ -29,7 +29,6 @@ func checkFileIsExist(filename string) bool {
eg: logic.Loginfo("逾期统计开始","_yuqilv_");
*/
func
Log
(
writeString
string
,
log_file_pre
string
)
{
return
log_file_pre
=
"_"
+
log_file_pre
date
:=
time
.
Now
()
.
Format
(
"2006-01-02"
)
date2
:=
time
.
Now
()
.
Format
(
"2006-01-02 15:04:05"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment