Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 23.1a
Hint_designer
PageDESIGNER:Logger Adapter
TopicLogger adapter

Tagged Values of the Logger Configuration

<<LogChannel>>

Multiexcerpt
MultiExcerptNameLogChannel

Runtime 2020.8 Builder 7.10.1

Tagged ValueDescriptionAllowed Values
nameName of the channel.

<<LogSink>>

Multiexcerpt
MultiExcerptNameLogSink

Runtime 2020.8 Builder 7.10.1

Tagged ValueDescriptionAllowed Values / Example
nameName of the sink.
fileNamePattern

Specify a filename/path pattern for the log file to be generated. You can use the variables listed at Log Filename.

Info
iconfalse

This tagged value will be only taken into account if you specify a sinkType that logs to a file.

logs/{channel}.{sink}_{date_time}.log
levelSpecify a log level. This log level serves as a filter and is the lowest log level this sink will accept. Refer to Log Levels of an xUML Service for a list of log levels.One of Fatal, Error, Warning, Info (default), and Debug.
sinkTypeSpecify where to log to. If logging to a file, the filename will be generated as specified with fileNamePattern.daily_rotated_fileLog to a daily rotated file (default).
hourly_rotated_fileLog to an hourly rotated file.
std_outLog to std_out.
std_errLog to std_err.

<<LogFormatter>>

Multiexcerpt
MultiExcerptNameLogFormatter

Runtime 2020.8 Builder 7.10.1

Tagged ValueDescriptionAllowed Values / Example
formatSpecify the log format.jsonLog contents will be formatted as JSON (default).
patternLog contents will be formatted by a pattern given with pattern.
patternSpecify a pattern for the log content format. This is only necessary if "pattern" is selected as format. You can use the variables and formatting options listed at Log Content.
[{timestamp:%d.%m.%Y %H:%M:%S}][{level}]{message}
timestamp_resolution



Runtime 2023.4 Specify the resolution of the timestamp to be logged.

  • Custom timestamps are limited to a resolution of microseconds due to the precision of the DateTime type. If you specify a higher resolution, "000" will be appended for nanoseconds.
  • The same will be done if the platform the service is running on does not provide an accurate enough timestamp, e.g. Windows is limited to a resolution of 100 nanoseconds.
secondsLog timestamps with a resolution of seconds (default).
millisecondsLog timestamps with a resolution of milliseconds.

microseconds

Log timestamps with a resolution of microseconds.
nanosecondsLog timestamps with a resolution of nanoseconds.

<<LogKeys>>

Multiexcerpt
MultiExcerptNameLogKeys

Runtime 2020.8 Builder 7.10.1

Tagged ValueDescriptionAllowed Values
nameSpecify the name of the log key you want to overwrite in the JSON file.channelOverwrites the key of the channel name.
atOverwrites the key of the timestamp.
messageOverwrites the key of the error description.
detailsOverwrites the key of the error details.
externalNameSpecify the name that should be written to the JSON file as a key instead of name.Any string that matches requirements of a JSON key.
externalType

Specify the type of the changed JSON attribute.

Info
iconfalse
Can only be used with DateTime values for now, resp. attribute at.
integerConvert content to Integer.
stringConvert content to String.
formatString

Specify a format string for the logged value.

Info
iconfalse
Can only be used with DateTime values for now, resp. attribute at.

A valid format string. Refer to Content Formatting Options further below for more information on formatting options.

Log Adapter Parameters

Action "log"

Multiexcerpt
MultiExcerptNameparameters_log
NameTypeDirectionDescriptionAllowed Values / Example
levelStringinSpecify one of the error log levels described in the log level guidelines on Log Levels of an xUML Service.One of Fatal, Error, Warning, Info, and Debug.
typeStringinSpecify a custom error domain.
Stock_Synchronization
codeStringinSpecify a custom error code.
SYNC001 
descriptionStringinSpecify a description for the log entry.
Item ID could not be found.
detailsAnyinRuntime 2020.6 Builder 7.8.0 Specify an object of complex type (class or array) that contains additional details. If provided, the contents of this object will be flattened and appended to the description.an error detail object

Action "logTo"

Multiexcerpt
MultiExcerptNameparameters_logTo

Runtime 2020.8 Builder 7.10.1

NameTypeDirectionDescriptionAllowed Values / Example
channelStringinSpecify the channel you want to log to.
levelStringinSpecify a log level. Allowed error log levels are described in the log level guidelines on Log Levels of an xUML Service.One of Fatal, Error, Warning, Info, and Debug.
messageStringinSpecify a description for the log entry.
Item ID could not be found.
detailsAnyin

Specify an object of complex type (class or array) that contains additional details. If provided, the contents of this object will be flattened and appended to the description for text files. In JSON files, details have their own key.

any detail object


Action "report"

Multiexcerpt
MultiExcerptNameparameters_report
Object NameTypeDirectionDescriptionField in Transaction LogAllowed Values / Example
domainStringinSpecify a self-defined name of the domain of the logged entry.Domain
Stock_Synchronization
stateBooleaninSpecify how to set the status field in the log entry. This will result in setting the status field in the log entry.StatetrueSet the status field to OK.
falseSet the status field to ERROR.
parameterStringinSpecify a self-defined parameter.Parameter 2
Item: YY-2388
AnyRuntime 2020.6 Builder 7.8.0 Specify an object of complex type (class or array) that contains additional details. The contents of this object will be flattened and logged instead of parameter.
e2e:type='ErrorDetail', element='YY-2388', value='Connector'
descriptionStringinSpecify a description for the log entry.Parameter 1Item ID could not be found.
timestampDateTimein

Bridge 7.0.0-beta2 Specify a custom timestamp. This parameter is optional. If it is not given, the timestamp in the transaction log will be generated from the current timestamp.

Info
iconfalse

timestamp and parameter (Any) are mutual exclusive: You cannot provide a custom timestamp when providing a details object.
In this case, the custom timestamp will be overwritten by the actual date and time.

Date, TimeNULLGenerated timestamp in the transaction log.
a valueDedicated timestamp in the transaction log.

Log Filename

Pattern Variables

Multiexcerpt
MultiExcerptNamefilename_pattern_variables

Runtime 2020.8 Builder 7.10.1

VariableDescription

{channel}

Channel name from the <<LogChannel>> class.
{sink}Sink name from name.
{date_time}Timestamp of format %Y-%m-%d or %Y-%m-%d-%H, depending on the sinkType .
{extension}

Value depends on the formatting specified in the <<LogFormatter>> class:

  • json: If json is selected as log format.
  • log: If pattern is selected as log format.

Pattern Formatting Options

Multiexcerpt
MultiExcerptNamepattern_formatting_options
PatternDescription
%Yyear, 4 digits
%mmonth, 2 digits
%dday of the month, 2 digits
%Hhour, 24-hour format, 2 digits
%Mminute, 2 digits
%Ssecond, 2 digits

Log Content

Text Pattern Variables

Multiexcerpt
MultiExcerptNamelog_content_text_pattern_variables

Runtime 2020.8 Builder 7.10.1

VariableDescription
{channel} Log channel.

{timestamp}

Timestamp.
{level}Log level.
{message}Log message.
{compositeName}Name of the service composite (see Frontend Components).
{trxIdTransaction id (see Contents of the Transaction Log).
{correlationIdCorrelation id (see Contents of the Transaction Log).

JSON Attributes

Multiexcerpt
MultiExcerptNamelog_content_json_attributes

Runtime 2020.8 Builder 7.10.1

JSON AttributeDescription
{channel} Log channel.

{at}

Timestamp.
{message}Log message.
{details}Serialized content of the details object.
{compositeName}Name of the service composite (see Frontend Components).
{trxIdTransaction id (see Contents of the Transaction Log).
{correlationIdCorrelation id (see Contents of the Transaction Log).

Content Formatting Options

You can format the output using pattern for text files and formatString for JSON files. When used in a pattern, add the formatting to the variable like {timestamp:<formatting options>}.

Reasonable format strings are:

Multiexcerpt
iconfalse
MultiExcerptNamecontent_formatting_options
PatternDescriptionExample Output
Format Patterns For Date/Time Variables
%YYear as a 4-digit decimal number.
2020
%mMonth as a 2-digit decimal number (range [01,12]).
07
%dDay of the month as a decimal number (range [01,31]).
15
%F
Equivalent to %Y-%m-%d.
2020-07-15
%HHour as a 2-digit decimal number, 24 hour clock (range [00-23])
16
%MMinute as a 2-digit decimal number (range [00,59])
34
%SSecond as a 2-digit decimal number (range [00,60])
25
%TEquivalent to "%H:%M:%S" (the ISO 8601 time format).
16:34:25
%zOffset from UTC in the ISO 8601 format, or no characters if the time zone information is not available.
+0200
Format Patterns for Numeric Variables
099Sign-aware zero-padding for numeric types, where 0 is the indicator to apply the padding and 99 the maximum padding width.010 → 10-digit number with leading zeros.

If you want to apply more sophisticated formatting, find more options on the {fmt} documentation pages for string formats and cpp documentation pages for date/time formats.