Skip to main content
Skip table of contents

Log Adapter Reference

This page explains the Logger adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to Logger Adapter in the Designer guide.

Tagged Values of the Logger Configuration

<<LogChannel>>

Runtime 2020.8 Builder 7.10.1

Tagged ValueDescriptionAllowed Values
nameName of the channel.

<<LogSink>>

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.

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 Bridge Server 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>>

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>>

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.

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.

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"

NameTypeDirectionDescriptionAllowed Values / Example
levelStringinSpecify one of the error log levels described in the log level guidelines on Bridge Server 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"

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 Bridge Server 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"

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.

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

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

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

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

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:

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.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.