This is an extended function of layout_json function
from 'logger' package. Objective is to add additional component in the
logging layout in JSON format so that they can also be reported while
logging along with the components collected by
.add_meta_variables.
.layout_json_custom(
log_fields = c("time", "level", "ns", "ans", "topenv", "fn", "node", "arch", "os_name",
"os_release", "os_version", "pid", "user", "msg"),
additional_fields = NULL,
enforce_ascii_msg = TRUE,
enforce_tz_utc = TRUE
)Returns a generator function typically to be used by
log_layout function.
Vector of components which are collected in
get_logger_meta_variables function. Converting
time component to UTC additionally.
A named vector of type list with key-value pairs of
additional meta data which needs to be added in logging context on top of
log_fields. The respective value of each key is expected to be of
length 1. It is NULL by default.
If TRUE (default), the logging message is
guaranteed to have all non-ASCII characters escaped. If FALSE, the
characters will be logged as-is. Please note, it is better to ensure
ASCII, otherwise there might be error while sending the HTTP POST request
to 'Azure Log Analytics' workspace.
If TRUE (default), the logging time field is
converted to UTC timezone while sending the logging dump to 'Azure Log
Analytics' workspace. If FALSE, then the local time captured by
Sys.time is recorded in the time field.