BlogGitHub
Core APIs Logging Create in-memory loggers, add context, use child scopes, and serialize logs to strings or JSON.

Create A Logger

Use the in-memory logger when you need a lightweight collector for tests, diagnostics, or application-local processing.

DATA(logger) = /ork/cl_logger=>s_new_in_memory( ).

Add Context

Logger instances are immutable. Methods that add context or scope return another logger instance, which makes it safe to pass scoped loggers into nested routines.

DATA(scoped_logger) = logger->child( `import` )->child( `customers` ).

Write Entries

The logger interface defines level constants and entry methods. Prefer structured context values where possible so downstream serialization stays useful.

logger->info( `Import started` ).

logger->error( `Import failed` ).

Serialize

Use the logger output methods when a test, file export, or transport boundary needs a string or JSON representation.

DATA(text_log) = logger->to_file_string( ).
DATA(json_log) = logger->to_json( )->to_string( ).

For application logging frameworks, treat /ork/if_logger as the boundary and adapt entries at the edge.