YOUSEFUL / DELPHI / COMPONENTS
TAtlasLogLayout
How a text sink writes an event: a text pattern or a JSON object.
Description
The type of TAtlasTextSink.Layout, used by the file, console and debugger sinks.
Members
| Member | Kind | What it does |
|---|---|---|
loText | value | One line made from the sink's Pattern (see TAtlasTextFormatter). |
loJson | value | One JSON object per line (see TAtlasJsonFormatter); Pattern is ignored. |
Values
loText value
loTextOne line made from the sink's Pattern (see TAtlasTextFormatter). The default.
loJson value
loJsonOne JSON object per line (see TAtlasJsonFormatter); Pattern is ignored.
Examples
JSON on the console
Machine-readable output for a service that another program reads.
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;
Related
TAtlasTextSink · TAtlasTextFormatter · TAtlasJsonFormatter
Also in Atlas Log
TAtlasLogger · TAtlasMemorySink · TAtlasCallbackSink · TAtlasConsoleSink · TAtlasDebugSink · TAtlasFileSink · TAtlasAsyncSink · TAtlasLogView