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
ee8499c6
Unverified
Commit
ee8499c6
authored
Feb 09, 2022
by
Matthew Slipper
Committed by
GitHub
Feb 09, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2176 from cfromknecht/bss-json-logs
feat: add LOG_TERMINAL flag, default to JSON
parents
5a3753dd
3ec06301
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
4 deletions
+26
-4
modern-gorillas-walk.md
.changeset/modern-gorillas-walk.md
+5
-0
batch_submitter.go
go/batch-submitter/batch_submitter.go
+4
-2
config.go
go/batch-submitter/config.go
+6
-0
flags.go
go/batch-submitter/flags/flags.go
+10
-2
batch-submitter.env
ops/envs/batch-submitter.env
+1
-0
No files found.
.changeset/modern-gorillas-walk.md
0 → 100644
View file @
ee8499c6
---
'
@eth-optimism/batch-submitter-service'
:
patch
---
Default to JSON logs, add LOG_TERMINAL flag for debugging
go/batch-submitter/batch_submitter.go
View file @
ee8499c6
...
...
@@ -54,9 +54,11 @@ func Main(gitVersion string) func(ctx *cli.Context) error {
return
err
}
logHandler
=
bsscore
.
SentryStreamHandler
(
os
.
Stdout
,
log
.
TerminalFormat
(
true
))
}
else
{
logHandler
=
bsscore
.
SentryStreamHandler
(
os
.
Stdout
,
log
.
JSONFormat
(
))
}
else
if
cfg
.
LogTerminal
{
logHandler
=
log
.
StreamHandler
(
os
.
Stdout
,
log
.
TerminalFormat
(
true
))
}
else
{
logHandler
=
log
.
StreamHandler
(
os
.
Stdout
,
log
.
JSONFormat
())
}
logLevel
,
err
:=
log
.
LvlFromString
(
cfg
.
LogLevel
)
...
...
go/batch-submitter/config.go
View file @
ee8499c6
...
...
@@ -118,6 +118,11 @@ type Config struct {
// LogLevel is the lowest log level that will be output.
LogLevel
string
// LogTerminal if true, prints to stdout in terminal format, otherwise
// prints using JSON. If SentryEnable is true this flag is ignored, and logs
// are printed using JSON.
LogTerminal
bool
// SentryEnable if true, logs any error messages to sentry. SentryDsn
// must also be set if SentryEnable is true.
SentryEnable
bool
...
...
@@ -191,6 +196,7 @@ func NewConfig(ctx *cli.Context) (Config, error) {
ClearPendingTxs
:
ctx
.
GlobalBool
(
flags
.
ClearPendingTxsFlag
.
Name
),
/* Optional Flags */
LogLevel
:
ctx
.
GlobalString
(
flags
.
LogLevelFlag
.
Name
),
LogTerminal
:
ctx
.
GlobalBool
(
flags
.
LogTerminalFlag
.
Name
),
SentryEnable
:
ctx
.
GlobalBool
(
flags
.
SentryEnableFlag
.
Name
),
SentryDsn
:
ctx
.
GlobalString
(
flags
.
SentryDsnFlag
.
Name
),
SentryTraceRate
:
ctx
.
GlobalDuration
(
flags
.
SentryTraceRateFlag
.
Name
),
...
...
go/batch-submitter/flags/flags.go
View file @
ee8499c6
...
...
@@ -129,6 +129,13 @@ var (
Value
:
"info"
,
EnvVar
:
prefixEnvVar
(
"LOG_LEVEL"
),
}
LogTerminalFlag
=
cli
.
BoolFlag
{
Name
:
"log-terminal"
,
Usage
:
"If true, outputs logs in terminal format, otherwise prints "
+
"in JSON format. If SENTRY_ENABLE is set to true, this flag is "
+
"ignored and logs are printed using JSON"
,
EnvVar
:
prefixEnvVar
(
"LOG_TERMINAL"
),
}
SentryEnableFlag
=
cli
.
BoolFlag
{
Name
:
"sentry-enable"
,
Usage
:
"Whether or not to enable Sentry. If true, sentry-dsn must also be set"
,
...
...
@@ -197,8 +204,8 @@ var (
EnvVar
:
prefixEnvVar
(
"METRICS_PORT"
),
}
HTTP2DisableFlag
=
cli
.
BoolFlag
{
Name
:
"http2-disable"
,
Usage
:
"Whether or not to disable HTTP/2 support."
,
Name
:
"http2-disable"
,
Usage
:
"Whether or not to disable HTTP/2 support."
,
EnvVar
:
prefixEnvVar
(
"HTTP2_DISABLE"
),
}
)
...
...
@@ -224,6 +231,7 @@ var requiredFlags = []cli.Flag{
var
optionalFlags
=
[]
cli
.
Flag
{
LogLevelFlag
,
LogTerminalFlag
,
SentryEnableFlag
,
SentryDsnFlag
,
SentryTraceRateFlag
,
...
...
ops/envs/batch-submitter.env
View file @
ee8499c6
...
...
@@ -3,6 +3,7 @@ ETH_NETWORK_NAME=clique
LOG_LEVEL=debug
BATCH_SUBMITTER_LOG_LEVEL=debug
BATCH_SUBMITTER_LOG_TERMINAL=true
BATCH_SUBMITTER_MAX_L1_TX_SIZE=90000
BATCH_SUBMITTER_MAX_BATCH_SUBMISSION_TIME=0
BATCH_SUBMITTER_POLL_INTERVAL=500ms
...
...
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