package tezos-stdlib-unix
An implementation of Tezos_base
.Internal_event.SINK which writes the events as JSON or pretty printed into a single file-descriptor.
It is registered with the URI scheme "file-descriptor-path"
to output to a file or "file-descriptor-stdout"
/"file-descriptor-stderr"
for stdout
and stderr
respectively.
Available options are
"level-at-least"
the minimal log-level that the sink will output (seeTezos_event_logging.Internal_event.level
)."section-prefix"
can be given many times and defines a list of pairs"<section-prefix>:<level-threshold>"
which can be used to setup more precise filters."level-at-least=info"
is understood as"section-prefix=:info"
(the empty section prefix matches all sections). To exclude completely a section from the log stream that the sink will output, you can use the special level-threshold "none"."format"
the output format used; acceptable values are"one-per-line"
(the default),"netstring"
(see The Netstring format) (both to separate JSON records), or"pp"
to output the events pretty-printed as text using thesyslog
format.
Options available only for "file-descriptor-path://"
:
"with-pid=true"
adds the current process id to the file path provided."fresh=true"
smashes the content of the file if it already exists instead of appending to it."chmod=<INT>"
sets the access-rights of the file at creation time (default is0o600
, providedumask
allows it).
Examples:
export TEZOS_EVENTS_CONFIG="file-descriptor-path:///the/path/to/write.log?format=one-per-line§ion-prefix=p2p.maintenance:none&with-pid=true&chmod=0o640"
: By default all executables will write all log events of level at leastInfo
to a file"/the/path/to/write-XXXX.log"
where"XXXX"
is the process ID, the file will be also readable by the user's group (0o640
). The maintenance module will be excluded from the stream.export TEZOS_EVENTS_CONFIG="file-descriptor-path:///the/path/to/write.log?section-prefix=rpc:debug§ion-prefix=validator:debug§ion-prefix=:none"
: Write only sections validator and rpc at debug level but exclude all other sections from the stream.export TEZOS_EVENTS_CONFIG="file-descriptor-path:///the/path/to/write.log?format=one-per-line&level-at-least=notice&with-pid=true&chmod=0o640"
: Executables will write all log events of level at leastNotice
to a file"/the/path/to/write-XXXX.log"
where"XXXX"
is the process ID, the file will be also readable by the user's group (0o640
)."export TEZOS_EVENTS_CONFIG=file-descriptor-stderr://?format=netstring"
Executables will write tostderr
.export TEZOS_EVENTS_CONFIG="file-descriptor-path:///dev/fd/4?format=netstring"
Executables will write to the4
file-descriptor likely opened by a parent monitoring process (non-standard feature available on mainstream UNIX hosts, e.g. Linux and MacOSX).
export TEZOS_EVENT_HOSTNAME="hostname"
Thehostname
will be used in the JSON representation of the event. By default, it is the hostname given byUnix.gethostname ()
.
module Sink_implementation_path :
Tezos_event_logging.Internal_event.SINK with type t = t
module Sink_implementation_stdout :
Tezos_event_logging.Internal_event.SINK with type t = t
module Sink_implementation_stderr :
Tezos_event_logging.Internal_event.SINK with type t = t
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>