Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
integrated-scheduling
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张晓彤
integrated-scheduling
Commits
bf5cad37
Commit
bf5cad37
authored
Sep 18, 2021
by
Allvey
Browse files
Options
Browse Files
Download
Plain Diff
修正日志路径
parents
32ce81a7
229caa7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
settings.py
settings.py
+4
-4
No files found.
settings.py
View file @
bf5cad37
...
@@ -27,8 +27,8 @@ import time
...
@@ -27,8 +27,8 @@ import time
log_path
=
"/usr/local/fleet-log/dispatch"
log_path
=
"/usr/local/fleet-log/dispatch"
# 创建日志目录
# 创建日志目录
#
if not os.path.exists(log_path):
if
not
os
.
path
.
exists
(
log_path
):
#
os.mkdir(log_path)
os
.
mkdir
(
log_path
)
# logging初始化工作
# logging初始化工作
logging
.
basicConfig
()
logging
.
basicConfig
()
...
@@ -38,8 +38,8 @@ logger.setLevel(logging.INFO)
...
@@ -38,8 +38,8 @@ logger.setLevel(logging.INFO)
# timefilehandler = logging.handlers.TimedRotatingFileHandler(log_path + "/dispatch.log", when='M', interval=1, backupCount=60)
# timefilehandler = logging.handlers.TimedRotatingFileHandler(log_path + "/dispatch.log", when='M', interval=1, backupCount=60)
#
filehandler = logging.handlers.RotatingFileHandler(log_path + "/dispatch.log", maxBytes=3*1024*1024, backupCount=10)
filehandler
=
logging
.
handlers
.
RotatingFileHandler
(
log_path
+
"/dispatch.log"
,
maxBytes
=
3
*
1024
*
1024
,
backupCount
=
10
)
filehandler
=
logging
.
handlers
.
RotatingFileHandler
(
"./Logs/dispatch.log"
,
maxBytes
=
3
*
1024
*
1024
,
backupCount
=
10
)
#
filehandler = logging.handlers.RotatingFileHandler("./Logs/dispatch.log", maxBytes=3 * 1024 * 1024, backupCount=10)
# 设置后缀名称,跟strftime的格式一样
# 设置后缀名称,跟strftime的格式一样
filehandler
.
suffix
=
"
%
Y-
%
m-
%
d_
%
H-
%
M.log"
filehandler
.
suffix
=
"
%
Y-
%
m-
%
d_
%
H-
%
M.log"
...
...
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