Skip to content

Commit be40dc8

Browse files
authored
chore: cleanup extraneous logging (coder#9156)
* The batchstats warning went out on every Ctrl+C in my development Rule of silence: The provisioner and connect messages messages were sent out on every startup without a corresponding user event, making them annoying and more-so debug messages.
1 parent 9710bad commit be40dc8

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

cli/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ func newProvisionerDaemon(
13591359
// in provisionerdserver.go to learn more!
13601360
return coderAPI.CreateInMemoryProvisionerDaemon(ctx, debounce)
13611361
}, &provisionerd.Options{
1362-
Logger: logger,
1362+
Logger: logger.Named("provisionerd"),
13631363
JobPollInterval: cfg.Provisioner.DaemonPollInterval.Value(),
13641364
JobPollJitter: cfg.Provisioner.DaemonPollJitter.Value(),
13651365
JobPollDebounce: debounce,

coderd/batchstats/batcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func (b *Batcher) run(ctx context.Context) {
183183
// If the flush lever is depressed, flush the buffer immediately.
184184
b.flush(authCtx, true, "reaching capacity")
185185
case <-ctx.Done():
186-
b.log.Warn(ctx, "context done, flushing before exit")
186+
b.log.Debug(ctx, "context done, flushing before exit")
187187
b.flush(authCtx, true, "exit")
188188
return
189189
}

coderd/workspaceagents.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,13 @@ func (api *API) postWorkspaceAgentStartup(rw http.ResponseWriter, r *http.Reques
211211
return
212212
}
213213

214-
api.Logger.Info(ctx, "post workspace agent version", slog.F("agent_id", apiAgent.ID), slog.F("agent_version", req.Version))
214+
api.Logger.Debug(
215+
ctx,
216+
"post workspace agent version",
217+
slog.F("agent_id", apiAgent.ID),
218+
slog.F("agent_version", req.Version),
219+
slog.F("remote_addr", r.RemoteAddr),
220+
)
215221

216222
if !semver.IsValid(req.Version) {
217223
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{

docs/admin/provisioners.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ for deploying the Coder server.
124124
--values provisioner-values.yaml
125125
```
126126

127-
You can verify that your provisioner daemons have successfully connected to Coderd by looking for a log with message
128-
`provisionerd successfully connected to coderd` from each Pod.
127+
You can verify that your provisioner daemons have successfully connected to Coderd by looking for a debug log message that says
128+
`provisionerd: successfully connected to coderd` from each Pod.
129129

130130
## Example: Running an external provisioner on a VM
131131

provisionerd/provisionerd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func (p *Server) connect(ctx context.Context) {
204204
p.clientValue.Store(ptr.Ref(client))
205205
p.mutex.Unlock()
206206

207-
p.opts.Logger.Info(ctx, "provisionerd successfully connected to coderd")
207+
p.opts.Logger.Debug(ctx, "successfully connected to coderd")
208208
break
209209
}
210210
select {

0 commit comments

Comments
 (0)