Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpha globals flag "--log_dir" in config.json is inoperative #2854

Closed
relunctance opened this issue Dec 29, 2018 · 2 comments · Fixed by #3062
Closed

alpha globals flag "--log_dir" in config.json is inoperative #2854

relunctance opened this issue Dec 29, 2018 · 2 comments · Fixed by #3062

Comments

@relunctance
Copy link

relunctance commented Dec 29, 2018

If you suspect this could be a bug, follow the template.

  • What version of Dgraph are you using?
Dgraph version   : v1.0.11-18-g4ca67ca
Commit SHA-1     : 4ca67ca
Commit timestamp : 2018-12-24 18:53:10 -0800
Branch           : master
Go version       : go1.11
  • Have you tried reproducing the issue with latest release?
    yes

  • What is the hardware spec (RAM, OS)?
    64G

  • Steps to reproduce the issue (command/config used to run Dgraph).
    -- cmd:

dgraph alpha --config /home/s/dgraph/conf/alpha.json

--alpha.json

{
   ... 
   "log_dir": "/home/s/dgraph/logs"
   ... 
}
  • Expected behaviour and actual result.
    In this scene , expect all logs are writed "/home/s/dgraph/logs" instead of "/tmp" .
log: exiting because of error: write /tmp/dgraph.dg.s.log.INFO.20181227-133013.23000: no space left on device
@danielmai
Copy link
Contributor

Although it’s not obvious, this is the expected behavior. The log flags like log_dir are handled by the glog library and are only configurable as command line flags and not via config files.

To prevent log files from being written and only writing to stderr, you can use the --logtostderr flag.

@relunctance
Copy link
Author

The log flags like log_dir are handled by the glog library and are only configurable as command line flags and not via config files.

That means --config can't use all flag .
On the other hand, if a new user show alpha command help , he won't know that "--log_dir" can't be used in configuration files unless he has been readed glog source code .
So, I suggest it's better to be compatible.

jarifibrahim added a commit to jarifibrahim/dgraph that referenced this issue Feb 25, 2019
This PR fixes hypermodeinc#2854

Why glog can't use values set in config file?
glog reads values from flags. When a user sets the value (of a glog flag) in a config file, glog doesn't recognize it because the flag value hasn't changed.

How does this PR fix it?
With this PR, we set the value of glog flags from the values in config file.
Note: This is a hack. glog doesn't allow setting configuration programatically and thus we have to use this hack.

Signed-off-by: Ibrahim Jarif <[email protected]>
manishrjain pushed a commit that referenced this issue Feb 26, 2019
* Set glog flags from configuration

This PR fixes #2854

Why glog can't use values set in config file?
glog reads values from flags. When a user sets the value (of a glog flag) in a config file, glog doesn't recognize it because the flag value hasn't changed.

How does this PR fix it?
With this PR, we set the value of glog flags from the values in config file.
Note: This is a hack. glog doesn't allow setting configuration programatically and thus we have to use this hack.

Signed-off-by: Ibrahim Jarif <[email protected]>

* Fix error check

Signed-off-by: Ibrahim Jarif <[email protected]>

* Fix line length

Signed-off-by: Ibrahim Jarif <[email protected]>
dna2github pushed a commit to dna2fork/dgraph that referenced this issue Jul 19, 2019
* Set glog flags from configuration

This PR fixes hypermodeinc#2854

Why glog can't use values set in config file?
glog reads values from flags. When a user sets the value (of a glog flag) in a config file, glog doesn't recognize it because the flag value hasn't changed.

How does this PR fix it?
With this PR, we set the value of glog flags from the values in config file.
Note: This is a hack. glog doesn't allow setting configuration programatically and thus we have to use this hack.

Signed-off-by: Ibrahim Jarif <[email protected]>

* Fix error check

Signed-off-by: Ibrahim Jarif <[email protected]>

* Fix line length

Signed-off-by: Ibrahim Jarif <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants