Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
f4faa44c
Unverified
Commit
f4faa44c
authored
Oct 14, 2022
by
Zach Howard
Committed by
GitHub
Oct 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds log level conf to proxyd (#3704)
parent
ed38dc6c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
0 deletions
+23
-0
wet-cameras-cover.md
.changeset/wet-cameras-cover.md
+5
-0
main.go
proxyd/cmd/proxyd/main.go
+15
-0
config.go
proxyd/config.go
+1
-0
example.config.toml
proxyd/example.config.toml
+2
-0
No files found.
.changeset/wet-cameras-cover.md
0 → 100644
View file @
f4faa44c
---
'
@eth-optimism/proxyd'
:
minor
---
adds server.log_level config
proxyd/cmd/proxyd/main.go
View file @
f4faa44c
...
@@ -37,6 +37,21 @@ func main() {
...
@@ -37,6 +37,21 @@ func main() {
log
.
Crit
(
"error reading config file"
,
"err"
,
err
)
log
.
Crit
(
"error reading config file"
,
"err"
,
err
)
}
}
// update log level from config
logLevel
,
err
:=
log
.
LvlFromString
(
config
.
Server
.
LogLevel
)
if
err
!=
nil
{
logLevel
=
log
.
LvlInfo
if
config
.
Server
.
LogLevel
!=
""
{
log
.
Warn
(
"invalid server.log_level set: "
+
config
.
Server
.
LogLevel
)
}
}
log
.
Root
()
.
SetHandler
(
log
.
LvlFilterHandler
(
logLevel
,
log
.
StreamHandler
(
os
.
Stdout
,
log
.
JSONFormat
()),
),
)
shutdown
,
err
:=
proxyd
.
Start
(
config
)
shutdown
,
err
:=
proxyd
.
Start
(
config
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Crit
(
"error starting proxyd"
,
"err"
,
err
)
log
.
Crit
(
"error starting proxyd"
,
"err"
,
err
)
...
...
proxyd/config.go
View file @
f4faa44c
...
@@ -14,6 +14,7 @@ type ServerConfig struct {
...
@@ -14,6 +14,7 @@ type ServerConfig struct {
WSPort
int
`toml:"ws_port"`
WSPort
int
`toml:"ws_port"`
MaxBodySizeBytes
int64
`toml:"max_body_size_bytes"`
MaxBodySizeBytes
int64
`toml:"max_body_size_bytes"`
MaxConcurrentRPCs
int64
`toml:"max_concurrent_rpcs"`
MaxConcurrentRPCs
int64
`toml:"max_concurrent_rpcs"`
LogLevel
string
`toml:"log_level"`
// TimeoutSeconds specifies the maximum time spent serving an HTTP request. Note that isn't used for websocket connections
// TimeoutSeconds specifies the maximum time spent serving an HTTP request. Note that isn't used for websocket connections
TimeoutSeconds
int
`toml:"timeout_seconds"`
TimeoutSeconds
int
`toml:"timeout_seconds"`
...
...
proxyd/example.config.toml
View file @
f4faa44c
...
@@ -19,6 +19,8 @@ ws_port = 8085
...
@@ -19,6 +19,8 @@ ws_port = 8085
# Maximum client body size, in bytes, that the server will accept.
# Maximum client body size, in bytes, that the server will accept.
max_body_size_bytes
=
10485760
max_body_size_bytes
=
10485760
max_concurrent_rpcs
=
1000
max_concurrent_rpcs
=
1000
# Server log level
log_level
=
"info"
[redis]
[redis]
# URL to a Redis instance.
# URL to a Redis instance.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment