Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Remember the last logging config in the agent.conf file. #7709
Conversation
| +// | ||
| +// When a new format version is introduced there is going to need to be some | ||
| +// refactoring around the config writing when provisioning a machine as the | ||
| +// controller may well understand a config format that the model does not. So |
| +func setupAgentLogging(config agent.Config) { | ||
| + | ||
| + if loggingOverride := config.Value(agent.LoggingOverride); loggingOverride != "" { | ||
| + logger.Infof("setting logging override to %q", loggingOverride) |
| + loggo.DefaultContext().ResetLoggerLevels() | ||
| + err := loggo.ConfigureLoggers(loggingConfig) | ||
| + if err != nil { | ||
| + logger.Errorf("setting logging config %v", err) |
| @@ -502,10 +491,8 @@ func (a *MachineAgent) Run(*cmd.Context) error { | ||
| return errors.Errorf("cannot read agent configuration: %v", err) | ||
| } | ||
| - logger.Infof("machine agent %v start (%s [%s])", a.Tag(), jujuversion.Current, runtime.Compiler) |
| @@ -148,10 +133,7 @@ func (a *UnitAgent) Run(ctx *cmd.Context) error { | ||
| if err := a.ReadConfig(a.Tag().String()); err != nil { | ||
| return err | ||
| } | ||
| - agentLogger.Infof("unit agent %v start (%s [%s])", a.Tag().String(), jujuversion.Current, runtime.Compiler) |
| lastConfig string | ||
| configOverride string | ||
| } | ||
| // NewLogger returns a worker.Worker that uses the notify watcher returned | ||
| // from the setup. | ||
| -func NewLogger(api *logger.State, agentConfig agent.Config) (worker.Worker, error) { | ||
| +func NewLogger(api *logger.State, agentConfig agent.Config, updateCallback func(string) error) (worker.Worker, error) { | ||
| logger := &Logger{ | ||
| api: api, | ||
| agentConfig: agentConfig, |
mjs
Aug 8, 2017
Contributor
Not your change but... the only thing this appears to get used for is the agent tag, so perhaps just store that instead of holding on to the config.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$try-again$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit c175ad1
into
juju:2.2
Aug 13, 2017
1 check passed
continuous-integration/jenkins/pr-merge
This commit looks good
Details
howbazaar
deleted the
howbazaar:2.2-save-logging-config
branch
Aug 13, 2017
howbazaar
referenced this pull request
Aug 15, 2017
Merged
Fix test race, and remove JujuConnSuite dependency. #7742
added a commit
that referenced
this pull request
Aug 15, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
howbazaar commentedAug 7, 2017
Description of change
When agents currently restart they all start with --debug. This has two problems, one is that there is significant noise whenever an agent restarts and you are only interested in INFO or greater, and it is impossible to trace the dependency engine startup.
QA steps
Bootstrap a new controller, and update the logging-config for the controller model.
SSH into one of the machines and look at the agent.conf file. It will have a logging-config value.
Restart the agent and observe it using that config to set up the logging when the agent starts.