Logging
debug_backtraceAt
Sets the logging backtrace location. When a backtrace location is set and a log message is emitted at that location, the stack of the goroutine executing the log statement will be printed to stderr
.
Client | Method Invocation |
---|---|
Console |
|
RPC |
|
Parameters
Name | Type | Description |
---|---|---|
location | string | The logging backtrace location specified as |
Return Value
None
Example
HTTP RPC
debug_setVMLogTarget
Sets the output target of vmlog precompiled contract. When the output target is a file, logs from vmlog
calls in smart contracts will be written to DATADIR/log/vm.log
. Here DATADIR
is the directory specified by --datadir
when launching klay
. On the other hand, the output target is stdout
, logs will be displayed like a debug message on the standard output.
Client | Method Invocation |
---|---|
Console |
|
RPC |
|
Parameters
Name | Type | Description |
---|---|---|
target | int | The output target (0: no output, 1: file, 2: stdout, 3: both) (default: 0) |
Return Value
Type | Description |
---|---|
string | The output target. See the examples below for the actual return values. |
Example
Console
HTTP RPC
debug_verbosity
Sets the logging verbosity ceiling. Log messages with level up to and including the given level will be printed.
(Level : 0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
The verbosity of individual packages and source files can be raised using debug_vmodule
.
Client | Method Invocation |
---|---|
Console |
|
RPC |
|
Parameters
Name | Type | Description |
---|---|---|
level | int | The logging verbosity level. |
Return Value
None
Example
Console
HTTP RPC
debug_verbosityByName
Sets the verbosity of log module with given name. Please note that VerbosityByName only works with zapLogger.
(Level : 0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
The verbosity of individual packages and source files can be raised using debug_vmodule
.
Client | Method Invocation |
---|---|
Console |
|
RPC |
|
Parameters
Name | Type | Description |
---|---|---|
name | string | The module name. |
level | int | The logging verbosity level. |
Return Value
None
Example
Console
HTTP RPC
debug_verbosityByID
Sets the verbosity of log module with given ModuleID. Please note that VerbosityByID only works with zapLogger.
(ModuleID : Please refer to the code on the github. )
(Level : 0=crit, 1=error, 2=warn, 3=info, 4=debug, 5=trace)
The verbosity of individual packages and source files can be raised using debug_vmodule
.
Client | Method Invocation |
---|---|
Console |
|
RPC |
|
Parameters
Name | Type | Description |
---|---|---|
id | int | The module id. |
level | int | The logging verbosity level. |
Return Value
None
Example
Console
HTTP RPC
debug_vmodule
Sets the logging verbosity pattern.
Client | Method Invocation |
---|---|
Console |
|
RPC |
|
Parameters
Name | Type | Description |
---|---|---|
module | string | The module name for logging. |
Return Value
None
Example
Console
If you want to see messages from a particular Go package (directory) and all subdirectories, use
If you want to restrict messages to a particular package (e.g., p2p) but exclude subdirectories, use
If you want to see log messages from a particular source file, use
HTTP RPC
Last updated