Support control of Raft debug logging
parent
bbd852e77d
commit
fb618cb385
|
@ -98,6 +98,7 @@ type Config struct {
|
|||
Logging struct {
|
||||
File string `toml:"file"`
|
||||
WriteTraceEnabled bool `toml:"write-tracing"`
|
||||
RaftTraceEnabled bool `toml:"raft-tracing"`
|
||||
} `toml:"logging"`
|
||||
|
||||
ContinuousQuery struct {
|
||||
|
|
|
@ -175,6 +175,7 @@ enabled = true
|
|||
[logging]
|
||||
file = "influxdb.log"
|
||||
write-tracing = true
|
||||
raft-tracing = true
|
||||
|
||||
# Configure the admin server
|
||||
[admin]
|
||||
|
|
|
@ -53,6 +53,9 @@ func Run(config *Config, join, version string, logWriter *os.File) (*messaging.B
|
|||
// Open broker, initialize or join as necessary.
|
||||
b := openBroker(config.BrokerDir(), config.BrokerURL(), initBroker, joinURLs, logWriter)
|
||||
|
||||
// Configure debug of Raft module.
|
||||
b.EnableRaftDebug(config.Logging.RaftTraceEnabled)
|
||||
|
||||
// Start the broker handler.
|
||||
var h *Handler
|
||||
if b != nil {
|
||||
|
|
|
@ -84,3 +84,4 @@ dir = "/tmp/influxdb/development/state"
|
|||
[logging]
|
||||
file = "/var/log/influxdb/influxd.log" # Leave blank to redirect logs to stderr.
|
||||
write-tracing = false # If true, enables detailed logging of the write system.
|
||||
raft-tracing = false # If true, enables detailed logging of Raft consensus.
|
||||
|
|
|
@ -75,6 +75,11 @@ func (b *Broker) SetLogOutput(w io.Writer) {
|
|||
b.log.SetLogOutput(w)
|
||||
}
|
||||
|
||||
// EnableRaftDebug controls debugging functionality in the Raft concensus module.
|
||||
func (b *Broker) EnableRaftDebug(enable bool) {
|
||||
b.log.DebugEnabled = enable
|
||||
}
|
||||
|
||||
// Open initializes the log.
|
||||
// The broker then must be initialized or join a cluster before it can be used.
|
||||
func (b *Broker) Open(path string, u *url.URL) error {
|
||||
|
|
Loading…
Reference in New Issue