Logging
Last updated
Last updated
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 |
---|---|
Parameters
Name | Type | Description |
---|---|---|
Return Value
None
Example
HTTP RPC
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.
Parameters
Return Value
Example
Console
HTTP RPC
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
.
Parameters
Return Value
None
Example
Console
HTTP RPC
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
.
Parameters
Return Value
None
Example
Console
HTTP RPC
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
.
Parameters
Return Value
None
Example
Console
HTTP RPC
Sets the logging verbosity pattern.
Parameters
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
Client | Method Invocation |
---|---|
Name | Type | Description |
---|---|---|
Type | Description |
---|---|
Client | Method Invocation |
---|---|
Name | Type | Description |
---|---|---|
Client | Method Invocation |
---|---|
Name | Type | Description |
---|---|---|
Client | Method Invocation |
---|---|
Name | Type | Description |
---|---|---|
Client | Method Invocation |
---|---|
Name | Type | Description |
---|---|---|
Console
debug.backtraceAt(location)
RPC
{"method": "debug_backtraceAt", "params": [string]}
location
string
The logging backtrace location specified as <filename>:<line>
.
Console
debug.setVMLogTarget(target)
RPC
{"method": "debug_setVMLogTarget", "params": [number]}
target
int
The output target (0: no output, 1: file, 2: stdout, 3: both) (default: 0)
string
The output target. See the examples below for the actual return values.
Console
debug.verbosity(level)
RPC
{"method": "debug_vmodule", "params": [number]}
level
int
The logging verbosity level.
Console
debug.verbosityByName(name, level)
RPC
{"method": "debug_verbosityByName", "params": [string, number]}
name
string
The module name.
level
int
The logging verbosity level.
Console
debug.verbosityByID(id, level)
RPC
{"method": "debug_verbosityByID", "params": [number, number]}
id
int
The module id.
level
int
The logging verbosity level.
Console
debug.vmodule(module)
RPC
{"method": "debug_vmodule", "params": [string]}
module
string
The module name for logging.