YOUSEFUL / DELPHI / COMPONENTS

TAtlasLogLayout

How a text sink writes an event: a text pattern or a JSON object.

Enumeration Unit Atlas.LogSinks · Product Atlas Log

Description

The type of TAtlasTextSink.Layout, used by the file, console and debugger sinks.

Members

MemberKindWhat it does
loTextvalueOne line made from the sink's Pattern (see TAtlasTextFormatter).
loJsonvalueOne JSON object per line (see TAtlasJsonFormatter); Pattern is ignored.

Values

loText value

loText

One line made from the sink's Pattern (see TAtlasTextFormatter). The default.

loJson value

loJson

One JSON object per line (see TAtlasJsonFormatter); Pattern is ignored.

Examples

JSON on the console

Machine-readable output for a service that another program reads.

pascal
uses Atlas.Log, Atlas.LogSinks;

procedure JsonConsole(Log: TAtlasLogger);
var
  Console: TAtlasConsoleSink;
begin
  Console := TAtlasConsoleSink.Create(Log);
  Console.Layout := loJson;
  Console.ErrorLevel := llOff;   // everything to standard output
  Console.Logger := Log;
end;

TAtlasTextSink · TAtlasTextFormatter · TAtlasJsonFormatter

Also in Atlas Log

TAtlasLogger · TAtlasMemorySink · TAtlasCallbackSink · TAtlasConsoleSink · TAtlasDebugSink · TAtlasFileSink · TAtlasAsyncSink · TAtlasLogView