The console log is not structured, and relies on already formatted/translated
messages

@param logRecord
@param txt the result of {@link #formatMessage}
@return Formatted string for the console
432987
public String consoleLogFormat(LogRecord logRecord, String txt) {
        StringBuilder sb = new StringBuilder(256);
        sb.append(BaseTraceFormatter.levelToString(logRecord.getLevel()));
        sb.append(txt);
        Throwable t = logRecord.getThrown();
        if (t != null) {
            String s = t.getLocalizedMessage();
            if (s == null)
                s = t.toString();
            sb.append(LoggingConstants.nl).append(s);
        }

        return sb.toString();
    }
676210
@Override
	public String formatLogMsg(LogEvent logEvent) {
		LogMessageType      messageInfo  = logEvent.getLogEntry().getMessageInfo();
		LogMetadataInfoType metadataInfo = logEvent.getLogEntry().getMetadataInfo();
		LogRuntimeInfoType  runtimeInfo  = logEvent.getLogEntry().getRuntimeInfo();

		String integrationScenarioId   = metadataInfo.getIntegrationScenarioId();
		String contractId              = metadataInfo.getContractId();
		String logMessage              = messageInfo.getMessage();
		String serviceImplementation   = metadataInfo.getServiceImplementation();
		String componentId             = runtimeInfo.getComponentId();
		String endpoint                = metadataInfo.getEndpoint();
		String messageId               = runtimeInfo.getMessageId();
		String businessCorrelationId   = runtimeInfo.getBusinessCorrelationId();
		String payload                 = logEvent.getLogEntry().getPayload();
		String businessContextIdString = businessContextIdToString(runtimeInfo.getBusinessContextId());
		String extraInfoString         = extraInfoToString(logEvent.getLogEntry().getExtraInfo());
		String logEventName            = "logEvent-" + messageInfo.getLevel().toString().toLowerCase();

		StringBuffer stackTrace = new StringBuffer();
		LogMessageExceptionType lmeException = logEvent.getLogEntry().getMessageInfo().getException();
		if (lmeException != null) {
			String ex = lmeException.getExceptionClass();
			String msg = lmeException.getExceptionMessage();
			List<String> st = lmeException.getStackTrace();

			stackTrace.append('\n').append("Stacktrace=").append(ex).append(": ").append(msg);
			for (String stLine : st) {
				if (stLine.startsWith(CAUSE_EXCEPTION_HEADER)) {
					stackTrace.append("\n\n").append(stLine);
					
				} else {
					stackTrace.append("\n\t at ").append(stLine);
				}
			}
		}
		return MessageFormatter.arrayFormat(LOG_STRING, new String[] {logEventName, integrationScenarioId, contractId, logMessage, serviceImplementation, runtimeInfo.getHostName(), runtimeInfo.getHostIp(), componentId, endpoint, messageId, businessCorrelationId, businessContextIdString, extraInfoString, payload, stackTrace.toString(), logEventName}).getMessage();
	}
1207173
function exec_console(func, log, format) {
                if (format === 'json') {
                    func(JSON.stringify(log));
                } else {
                    func(
                        ' ' + log.type + '\n',
                        'CREATED: ' + log.created + '\t ' + '\n',
                        'MESSAGE: ' + log.message + '\t ' + log.trace + '\n',
                        !!log.data ? 'DATA:' + log.data + '\n' : '',
                        '\n'
                    );
                }
            }
968455
function consoleHandler(record) {
  if (typeof console === 'undefined' || !console) {
    return;
  }
  record = /** @type {!LogRecord} */(record);
  var timestamp = new Date(record.getMillis());
  var msg =
      '[' + timestamp.getUTCFullYear() + '-' +
      padNumber(timestamp.getUTCMonth() + 1, 2) + '-' +
      padNumber(timestamp.getUTCDate(), 2) + 'T' +
      padNumber(timestamp.getUTCHours(), 2) + ':' +
      padNumber(timestamp.getUTCMinutes(), 2) + ':' +
      padNumber(timestamp.getUTCSeconds(), 2) + 'Z]' +
      '[' + record.getLevel().name + ']' +
      '[' + record.getLoggerName() + '] ' +
      record.getMessage();

  var level = record.getLevel().value;
  if (level >= Logger.Level.SEVERE.value) {
    console.error(msg);
  } else if (level >= Logger.Level.WARNING.value) {
    console.warn(msg);
  } else {
    console.log(msg);
  }
}
1250032
def _LogRecord_msg():
    

    def _LogRecord_msgProperty(self):
        return self.__msg

    def _LogRecord_msgSetter(self, value):
        self.__msg = to_unicode(value)

    logging.LogRecord.msg = property(_LogRecord_msgProperty, _LogRecord_msgSetter)
1030204
public String logMessage(String strTrxID, BaseMessage trxMessage, String strMessageInfoType, String strMessageProcessType, String strMessageStatus, String strContactType, String strPerson, String strMessageDescription, int iUserID, int iMessageReferenceID, Message message, String strDest)
    {
        return super.logMessage(strTrxID, trxMessage, strMessageInfoType, strMessageProcessType, strMessageStatus, strContactType, strPerson, strMessageDescription, iUserID, iMessageReferenceID, message, strDest);
    }
979751
@Override
	public String formatRecord(RepositoryLogRecord record, Locale locale) {
		if (null == record) {
			throw new IllegalArgumentException("Record cannot be null");
		}
		StringBuilder sb = new StringBuilder(300);
		String lineSeparatorPlusPadding = "";


		// Use basic format
		createEventHeader(record, sb);
		lineSeparatorPlusPadding = svLineSeparatorPlusBasicPadding;

		// add the localizedMsg
		sb.append(formatMessage(record, locale));

		// if we have a stack trace, append that to the formatted output.
		if (record.getStackTrace() != null) {
			sb.append(lineSeparatorPlusPadding);
			sb.append(record.getStackTrace());
		}
		return sb.toString();
	}
852999
public static StringBuilder formatErrors( Collection<? extends RoboconfError> errors, Log log ) {

		StringBuilder result = new StringBuilder();
		for( Map.Entry<RoboconfError,String> entry : RoboconfErrorHelpers.formatErrors( errors, null, true ).entrySet()) {
			if( entry.getKey().getErrorCode().getLevel() == ErrorLevel.WARNING )
				log.warn( entry.getValue());
			else
				log.error( entry.getValue());

			result.append( entry.getValue());
			result.append( "\n" );
		}

		return result;
	}
922679
public LoggingFraction consoleHandler(Level level, String formatter) {
        consoleHandler(new ConsoleHandler(CONSOLE)
                .level(level)
                .namedFormatter(formatter));
        return this;
    }
872521
public static String format (Object message, Object... args)
    {
        return new LogBuilder(message, args).toString();
    }
204744
def format(self, record):
        """"""
        record = ColoredRecord(record)
        record.log_color = self.color(self.log_colors, record.levelname)

        # Set secondary log colors
        if self.secondary_log_colors:
            for name, log_colors in self.secondary_log_colors.items():
                color = self.color(log_colors, record.levelname)
                setattr(record, name + '_log_color', color)

        # Format the message
        if sys.version_info > (2, 7):
            message = super(ColoredFormatter, self).format(record)
        else:
            message = logging.Formatter.format(self, record)

        # Add a reset code to the end of the message
        # (if it wasn't explicitly added in format str)
        if self.reset and not message.endswith(escape_codes['reset']):
            message += escape_codes['reset']

        if '|' in message:
            desc, data = message.split("|", 1)
            desc = desc + escape_codes['reset']
            data = escape_codes['green'] + data
            message = desc + '|' + data

        return message
367395
@Override
  public String format(LogRecord log)
  {
    StringBuilder sb = new StringBuilder();
    
    int mark = 0;

    for (FormatItem item : _formatList) {
      item.format(sb, log, mark);
      
      if (item instanceof PrettyPrintMarkItem) {
        mark = sb.length();
      }
    }
    
    return sb.toString();
  }
1020462
def format (self, record):
        """"""
        record.hostname = self.hostname
        return logging.Formatter.format(self, record)
777524
private static String formatLogParam(Clob obj) {
		String result="";
		try {
			result= "(cblob of length "+obj.length()+")";
		} catch (SQLException e) {
			result = "(cblob of unknown length)";
		}
		return result;
	}
1204829
@Override
    public synchronized String format(LogRecord record) {
        StringBuilder sb = new StringBuilder();

        ZonedDateTime timestamp = ZonedDateTime.ofInstant(
                Instant.ofEpochMilli(record.getMillis()),
                ZoneId.systemDefault());

        sb.append(formatter.format(timestamp));
        sb.append(" | ");//$NON-NLS-1$

        if (record.getSourceClassName() != null) {
            sb.append(truncate(
                    record.getSourceClassName().substring(
                            record.getSourceClassName().lastIndexOf('.') + 1),
                    30));
        } else {
            sb.append(truncate(record.getLoggerName(), 10));
        }

        sb.append(" | "); //$NON-NLS-1$

        if (record.getSourceMethodName() != null) {
            sb.append(truncate(record.getSourceMethodName(), 30));
        }

        sb.append(" | "); //$NON-NLS-1$

        String message = formatMessage(record);
        sb.append(truncate(record.getLevel().getLocalizedName(), MAX_LEVEL_SIZE));

        sb.append(" | ");//$NON-NLS-1$

        sb.append(message);

        sb.append(System.getProperty("line.separator")); //$NON-NLS-1$
        if (record.getThrown() != null) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            record.getThrown().printStackTrace(pw);
            pw.close();
            sb.append(sw.toString());
        }
        return sb.toString();
    }
656235
public String logMessage(String strTrxIDIn, BaseMessage trxMessage, String strMessageInfoType, String strMessageProcessType, String strMessageStatus, String strMessageDescription, String strMessageMimeType)
    {
        String strTrxID = strTrxIDIn;
        int iUserID = -1;
        String strContactType = null;
        String strContact = null;
        int iMessageReferenceID = -1;

        Task taskParent = this.getTask();
        Record recMessageLog = this.getRecord(MessageLog.MESSAGE_LOG_FILE);
        if (recMessageLog == null)
            recMessageLog = Record.makeRecordFromClassName(MessageLogModel.THICK_CLASS, this);
        try {
            if (strTrxID != null)
            {
                recMessageLog.getField(MessageLogModel.ID).setString(strTrxID);
                recMessageLog.setKeyArea(MessageLogModel.ID);
                if (recMessageLog.seek(null))
                {
                    recMessageLog.edit();
                }
                else
                    strTrxID = null;
            }
            if (strTrxID == null)
                recMessageLog.addNew();
            ReferenceField fldReference = (ReferenceField)recMessageLog.getField(MessageLogModel.MESSAGE_INFO_TYPE_ID);
            int iMessageInfoTypeID = fldReference.getIDFromCode(strMessageInfoType);
            fldReference.setValue(iMessageInfoTypeID);  // Message type
            fldReference = (ReferenceField)recMessageLog.getField(MessageLogModel.MESSAGE_TYPE_ID);
            int iMessageProcessTypeID = fldReference.getIDFromCode(strMessageProcessType);
            fldReference.setValue(iMessageProcessTypeID);  // Message type
            
            fldReference = (ReferenceField)recMessageLog.getField(MessageLogModel.MESSAGE_STATUS_ID);
            String objNativeMessage = null;
            if (objNativeMessage == null)
                if (trxMessage != null)
                    if (trxMessage.getExternalMessage() != null)
                        if (!MessageStatusModel.ERROR.equals(strMessageStatus))
                            objNativeMessage = trxMessage.getExternalMessage().toString();
            if (objNativeMessage == null)
                if (strMessageStatus == null)
                    strMessageStatus = MessageStatusModel.TRX_ID_HOLD;
            if (strMessageStatus == null)
                strMessageStatus = MessageStatusModel.UNKNOWN;
            int iMessageTimeout = 0;
            if (trxMessage != null)
                if (MessageStatusModel.SENT.equalsIgnoreCase(strMessageStatus))
                {
                    if ((trxMessage.getMessageHeader().get(TrxMessageHeader.MESSAGE_RESPONSE_ID) == null)
                        && (trxMessage.getMessageHeader().get(TrxMessageHeader.MESSAGE_RESPONSE_CODE) == null)
                        && (trxMessage.getMessageHeader().get(TrxMessageHeader.MESSAGE_RESPONSE_CLASS) == null))
                            strMessageStatus = MessageStatusModel.SENTOK;    // If I'm not expecting a response, status is sent okay.
                    else
                        if (trxMessage.getMessageHeader().get(TrxMessageHeader.MESSAGE_TIMEOUT) != null)
                        {
                            try {
                                iMessageTimeout = Integer.parseInt((String)trxMessage.getMessageHeader().get(TrxMessageHeader.MESSAGE_TIMEOUT));
                            } catch (NumberFormatException ex) {
                                iMessageTimeout = 0;
                            }
                        }
                }
            recMessageLog.getField(MessageLogModel.TIMEOUT_SECONDS).setValue(iMessageTimeout);
            if ((fldReference.isNull()) || (!MessageStatusModel.ERROR.equalsIgnoreCase(fldReference.getReference().getField(MessageStatusModel.CODE).toString())))
            {   // Can't change error status to something else
                int iMessageStatusID = fldReference.getIDFromCode(strMessageStatus);
                fldReference.setValue(iMessageStatusID);  // Message type
            }
            
            String strMessageTransport = this.getMessageTransportType();
            fldReference = (ReferenceField)recMessageLog.getField(MessageLogModel.MESSAGE_TRANSPORT_ID);
            int iMessageTransportID = fldReference.getIDFromCode(strMessageTransport);
            fldReference.setValue(iMessageTransportID);  // Message type
            
            String strReferenceType = null;
            int iMessageProcessInfoID = -1;

            if (!MessageStatusModel.ERROR.equals(strMessageStatus))
                if ((trxMessage != null) && (trxMessage.getMessageHeader() != null))
            {
                TrxMessageHeader trxMessageHeader = (TrxMessageHeader)trxMessage.getMessageHeader();
                if (strMessageDescription == null)
                    strMessageDescription = Utility.convertObjectToString(trxMessageHeader.get(TrxMessageHeader.DESCRIPTION));
                strContactType = Utility.convertObjectToString(trxMessageHeader.get(TrxMessageHeader.CONTACT_TYPE));
                if (strContactType != null)
                    if (strContactType.length() > 0)
                        if (!Utility.isNumeric(strContactType))
                {       // Convert the contact type from the record name to the ID.
                    Record recContactType = ((ReferenceField)recMessageLog.getField(MessageLogModel.CONTACT_TYPE_ID)).getReferenceRecord();
                    recContactType.setKeyArea(ContactTypeModel.CODE_KEY);
                    recContactType.getField(ContactTypeModel.CODE).setString(strContactType);
                    try {
                        if (recContactType.seek(null))
                        {   // Success
                            strContactType = recContactType.getField(ContactTypeModel.ID).toString();
                        }
                    } catch (DBException ex)    {
                        ex.printStackTrace();
                    }
                }
                strContact = Utility.convertObjectToString(trxMessageHeader.get(TrxMessageHeader.CONTACT_ID));
                Object objUserID = trxMessageHeader.get(DBParams.USER_ID);
                if (objUserID == null)
                    objUserID = trxMessageHeader.get(DBParams.USER_NAME);
                if (objUserID instanceof Integer)
                    iUserID = ((Integer)objUserID).intValue();
                else if (objUserID instanceof String)
                {
                    if (Utility.isNumeric((String)objUserID))
                        iUserID = Integer.parseInt((String)objUserID);
                    else
                    {
                        Record recUserInfo = Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS, this);
                        if (((UserInfoModel)recUserInfo).getUserInfo((String)objUserID, false))
                            iUserID = (int)recUserInfo.getField(UserInfoModel.ID).getValue();
                        recUserInfo.free();
                    }
                }
                Object objMessageReferenceID = trxMessageHeader.get(TrxMessageHeader.REFERENCE_ID);
                if (objMessageReferenceID == null)
                	objMessageReferenceID = trxMessage.get(TrxMessageHeader.REFERENCE_ID);
                if (objMessageReferenceID instanceof Integer)
                    iMessageReferenceID = ((Integer)objMessageReferenceID).intValue();
                else if (objMessageReferenceID instanceof String)
                {
                    if (Utility.isNumeric((String)objMessageReferenceID))
                        iMessageReferenceID = Integer.parseInt((String)objMessageReferenceID);
                }
                if (trxMessageHeader.get(TrxMessageHeader.REFERENCE_TYPE) != null)
                	strReferenceType = (String)trxMessageHeader.get(TrxMessageHeader.REFERENCE_TYPE);
                if (strReferenceType == null)
                		strReferenceType = (String)trxMessage.get(TrxMessageHeader.REFERENCE_TYPE);
                if (trxMessageHeader.get(TrxMessageHeader.MESSAGE_PROCESS_INFO_ID) != null)
                {
                    Object objMessageProcessInfoID = trxMessageHeader.get(TrxMessageHeader.MESSAGE_PROCESS_INFO_ID);
                    if (objMessageProcessInfoID instanceof Integer)
                    	iMessageProcessInfoID = ((Integer)objMessageProcessInfoID).intValue();
                    else if (objMessageProcessInfoID instanceof String)
                    {
                        if (Utility.isNumeric((String)objMessageProcessInfoID))
                        	iMessageProcessInfoID = Integer.parseInt((String)objMessageProcessInfoID);
                    }
                }
            }

            if (iUserID != -1)
                recMessageLog.getField(MessageLogModel.USER_ID).setValue(iUserID);
            else if (taskParent != null)
                recMessageLog.getField(MessageLogModel.USER_ID).setString(((BaseApplication)taskParent.getApplication()).getUserID());

            if (strContactType != null)
                recMessageLog.getField(MessageLogModel.CONTACT_TYPE_ID).setString(strContactType);
            if (strContact != null)
                recMessageLog.getField(MessageLogModel.CONTACT_ID).setString(strContact);
            if (strMessageDescription != null)
                recMessageLog.getField(MessageLogModel.DESCRIPTION).setString(strMessageDescription);
            recMessageLog.getField(MessageLogModel.MESSAGE_TIME).setValue(DateTimeField.currentTime());
            if (iMessageProcessInfoID != -1)
                recMessageLog.getField(MessageLogModel.MESSAGE_PROCESS_INFO_ID).setValue(iMessageProcessInfoID);
            if (strReferenceType != null)
            	recMessageLog.getField(MessageLogModel.REFERENCE_TYPE).setString(strReferenceType);
            if (iMessageReferenceID != -1)
                recMessageLog.getField(MessageLogModel.REFERENCE_ID).setValue(iMessageReferenceID);
            if (strMessageInfoType != null)
                recMessageLog.getField(MessageLogModel.MESSAGE_DATA_TYPE).setString(strMessageInfoType);

            if (!MessageStatusModel.ERROR.equals(strMessageStatus))
                if (trxMessage != null)
            {
                recMessageLog.getField(MessageLogModel.MESSAGE_CLASS_NAME).setString(trxMessage.getClass().getName());
                if (trxMessage.getMessageHeader() != null)
                {
                    recMessageLog.getField(MessageLogModel.MESSAGE_HEADER_CLASS_NAME).setString(trxMessage.getMessageHeader().getClass().getName());
                    recMessageLog.getField(MessageLogModel.MESSAGE_QUEUE_NAME).setString(trxMessage.getMessageHeader().getQueueName());
                    recMessageLog.getField(MessageLogModel.MESSAGE_QUEUE_TYPE).setString(trxMessage.getMessageHeader().getQueueType());
                    Map<String,Object> propHeaderInfo = ((TrxMessageHeader)trxMessage.getMessageHeader()).getMessageInfoMap();
                    if (propHeaderInfo != null)
                        ((PropertiesField)recMessageLog.getField(MessageLogModel.MESSAGE_INFO_PROPERTIES)).setProperties(propHeaderInfo);
                    Map<String,Object> propMessageHeader = ((TrxMessageHeader)trxMessage.getMessageHeader()).getMessageHeaderMap();
                    if (propMessageHeader != null)
                        ((PropertiesField)recMessageLog.getField(MessageLogModel.MESSAGE_HEADER_PROPERTIES)).setProperties(propMessageHeader);
                    Map<String,Object> propHeaderTransport = ((TrxMessageHeader)trxMessage.getMessageHeader()).getMessageTransportMap();
                    if (propHeaderTransport != null)
                        ((PropertiesField)recMessageLog.getField(MessageLogModel.MESSAGE_TRANSPORT_PROPERTIES)).setProperties(propHeaderTransport);
                }
                String strMessage = trxMessage.getXML(false);
                recMessageLog.getField(MessageLogModel.XML_MESSAGE_DATA).setString(strMessage);
                if (trxMessage.getMessageDataDesc(null) != null)
                    recMessageLog.getField(MessageLogModel.MESSAGE_DATA_CLASS_NAME).setString(trxMessage.getMessageDataDesc(null).getClass().getName());
                if (trxMessage.getExternalMessage() != null)
                    recMessageLog.getField(MessageLogModel.EXTERNAL_MESSAGE_CLASS_NAME).setString(trxMessage.getExternalMessage().getClass().getName());
            }
            if (objNativeMessage != null)
                recMessageLog.getField(MessageLogModel.MESSAGE_DATA).setString(objNativeMessage.toString());

            if (MessageStatusModel.ERROR.equals(strMessageStatus))
                recMessageLog.getField(MessageLogModel.ERROR_TEXT).setString(strMessageDescription);

            if (strTrxID == null)
            {
                recMessageLog.add();
                strTrxID = recMessageLog.getLastModified(DBConstants.BOOKMARK_HANDLE).toString();
            }
            else
                recMessageLog.set();
            
        } catch (DBException ex)    {
            ex.printStackTrace();
            strTrxID = null;
        } finally {
            // No, leave it here!
            // recMessageLog.free();
        }
        
        if ((MessageStatusModel.TRX_ID_HOLD.equals(strMessageStatus)) || (strTrxIDIn == null))
            if (trxMessage != null)
                if (trxMessage.getMessageHeader() instanceof TrxMessageHeader)
                    ((TrxMessageHeader)trxMessage.getMessageHeader()).put(TrxMessageHeader.LOG_TRX_ID, strTrxID);

        return strTrxID;
    }
32279
@Override
    public String getFormattedMessage() {
        return message = message == null ? String.valueOf(charSequence) : message ;
    }