Skip to contents

Get or set log record layout

Usage

log_layout(layout = NULL, namespace = "global", index = 1)

Arguments

layout

function defining the structure of a log record, eg layout_simple(), layout_glue() or layout_glue_colors(), layout_json(), or generator functions such as layout_glue_generator(), default NULL

namespace

logger namespace

index

index of the logger within the namespace

See also

Other log configutation functions: log_appender(), log_formatter(), log_threshold()

Examples

log_layout(layout_json())
log_info(42)
#> {"time":"2024-10-21 07:31:19","level":"INFO","ns":"global","ans":"global","topenv":"R_GlobalEnv","fn":"eval","node":"fv-az1198-739","arch":"x86_64","os_name":"Linux","os_release":"6.5.0-1025-azure","os_version":"#26~22.04.1-Ubuntu SMP Thu Jul 11 22:33:04 UTC 2024","pid":8176,"user":"runner","msg":"42"}