Skip to content

Commit 16bc2db

Browse files
chore: reduce volume of logs produced by the api (#389)
## πŸ“ Description Enables configuration of rbac-ee log level with env var in runtime reduces the ammount of logs that we produce in self hosted hub api by logging less data and only api errors ## βœ… Checklist - [ ] I have tested this change - [ ] This change requires documentation update
1 parent 9c7f920 commit 16bc2db

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

β€Žee/rbac/config/config.exs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import Config
22

3-
config :logger, level: (System.get_env("LOG_LEVEL") || "debug") |> String.to_atom()
4-
53
# Configures Elixir's Logger
64
config :logger, :console,
75
format: "$time $metadata[$level] $message\n",

β€Žee/rbac/config/runtime.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Config
22

3+
config :logger, level: (System.get_env("LOG_LEVEL") || "debug") |> String.to_atom()
4+
35
config :rbac, Rbac.Repo,
46
adapter: Ecto.Adapters.Postgres,
57
database: System.get_env("POSTGRES_DB_NAME") || "guard",

β€Žself_hosted_hub/pkg/logging/logging.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ func ForAgent(agent *models.Agent) *log.Entry {
1212

1313
return log.WithFields(
1414
log.Fields{
15-
"organization_id": agent.OrganizationID,
16-
"agent_type": agent.AgentTypeName,
1715
"agent_id": agent.ID,
18-
"agent_name": agent.Name,
19-
"agent_version": agent.Version,
2016
},
2117
)
2218
}

0 commit comments

Comments
Β (0)