Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210360228
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210360228
Commits
eb064421
Unverified
Commit
eb064421
authored
4 years ago
by
panda-sheep
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Generate log directory if not exist (#873)
Co-authored-by:
Yee
<
2520865+yixinglu@users.noreply.github.com
>
parent
3c66147b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conf/nebula-graphd.conf.default
+1
-1
1 addition, 1 deletion
conf/nebula-graphd.conf.default
conf/nebula-graphd.conf.production
+1
-1
1 addition, 1 deletion
conf/nebula-graphd.conf.production
src/daemons/GraphDaemon.cpp
+9
-0
9 additions, 0 deletions
src/daemons/GraphDaemon.cpp
with
11 additions
and
2 deletions
conf/nebula-graphd.conf.default
+
1
−
1
View file @
eb064421
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
--enable_optimizer=true
--enable_optimizer=true
########## logging ##########
########## logging ##########
# The directory to host logging files
, which must already exists
# The directory to host logging files
--log_dir=logs
--log_dir=logs
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
--minloglevel=0
...
...
This diff is collapsed.
Click to expand it.
conf/nebula-graphd.conf.production
+
1
−
1
View file @
eb064421
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
--enable_optimizer=true
--enable_optimizer=true
########## logging ##########
########## logging ##########
# The directory to host logging files
, which must already exists
# The directory to host logging files
--log_dir=logs
--log_dir=logs
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
--minloglevel=0
...
...
This diff is collapsed.
Click to expand it.
src/daemons/GraphDaemon.cpp
+
9
−
0
View file @
eb064421
...
@@ -25,6 +25,7 @@ using nebula::Status;
...
@@ -25,6 +25,7 @@ using nebula::Status;
using
nebula
::
ProcessUtils
;
using
nebula
::
ProcessUtils
;
using
nebula
::
graph
::
GraphService
;
using
nebula
::
graph
::
GraphService
;
using
nebula
::
network
::
NetworkUtils
;
using
nebula
::
network
::
NetworkUtils
;
using
nebula
::
fs
::
FileUtils
;
static
std
::
unique_ptr
<
apache
::
thrift
::
ThriftServer
>
gServer
;
static
std
::
unique_ptr
<
apache
::
thrift
::
ThriftServer
>
gServer
;
...
@@ -197,6 +198,14 @@ void signalHandler(int sig) {
...
@@ -197,6 +198,14 @@ void signalHandler(int sig) {
Status
setupLogging
()
{
Status
setupLogging
()
{
// If the log directory does not exist, try to create
if
(
!
FileUtils
::
exist
(
FLAGS_log_dir
))
{
if
(
!
FileUtils
::
makeDir
(
FLAGS_log_dir
))
{
return
Status
::
Error
(
"Failed to create log directory `%s'"
,
FLAGS_log_dir
.
c_str
());
}
}
if
(
!
FLAGS_redirect_stdout
)
{
if
(
!
FLAGS_redirect_stdout
)
{
return
Status
::
OK
();
return
Status
::
OK
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment