Package org.apache.logging.log4j.message

Examples of org.apache.logging.log4j.message.StructuredDataId


        } else {
            buf.append("-");
        }
        buf.append(" ");
        if (isStructured || includeMDC) {
            StructuredDataId id = null;
            String text;
            if (isStructured) {
                final StructuredDataMessage data = (StructuredDataMessage) msg;
                final Map<String, String> map = data.getData();
                id = data.getId();
                formatStructuredElement(id, eventPrefix, map, buf, noopChecker);
                text = data.getFormat();
            } else {
                text = msg.getFormattedMessage();
            }
            if (includeMDC) {
                Map<String, String> map = event.getContextMap();
                if (mdcRequired != null) {
                    checkRequired(map);
                }
                final int ein = id == null || id.getEnterpriseNumber() < 0 ?
                    enterpriseNumber : id.getEnterpriseNumber();
                final StructuredDataId mdcSDID = new StructuredDataId(mdcId, ein, null, null);
                formatStructuredElement(mdcSDID, mdcPrefix, map, buf, checker);
            }
            if (text != null && text.length() > 0) {
                buf.append(" ").append(escapeNewlines(text, escapeNewLine));
            }
View Full Code Here


        } else {
            buf.append("-");
        }
        buf.append(" ");
        if (isStructured || includeMDC) {
            StructuredDataId id = null;
            String text;
            if (isStructured) {
                StructuredDataMessage data = (StructuredDataMessage) msg;
                Map<String, String> map = data.getData();
                id = data.getId();
                formatStructuredElement(id, map, buf, noopChecker);
                text = data.getFormat();
            } else {
                text = msg.getFormattedMessage();
            }
            if (includeMDC) {
                if (mdcRequired != null) {
                    checkRequired(event.getContextMap());
                }
                int ein = id == null || id.getEnterpriseNumber() < 0 ? enterpriseNumber : id.getEnterpriseNumber();
                StructuredDataId mdcSDID = new StructuredDataId(mdcId, ein, null, null);
                formatStructuredElement(mdcSDID, event.getContextMap(), buf, checker);
            }
            if (text != null && text.length() > 0) {
                buf.append(" ").append(text);
            }
View Full Code Here

        addGuid(headers);
    }

    protected void addStructuredData(String prefix, Map<String, String> fields, StructuredDataMessage msg) {
        fields.put(prefix + EVENT_TYPE, msg.getType());
        StructuredDataId id = msg.getId();
        fields.put(prefix + EVENT_ID, id.getName());
    }
View Full Code Here

        } else {
            buf.append("-");
        }
        buf.append(" ");
        if (isStructured || includeMDC) {
            StructuredDataId id = null;
            String text;
            if (isStructured) {
                StructuredDataMessage data = (StructuredDataMessage) msg;
                Map map = data.getData();
                id = data.getId();
                formatStructuredElement(id, map, buf, noopChecker);
                text = data.getMessageFormat();
            } else {
                text = msg.getFormattedMessage();
            }
            if (includeMDC) {
                if (mdcRequired != null) {
                    checkRequired(event.getContextMap());
                }
                int ein = id == null || id.getEnterpriseNumber() < 0 ? enterpriseNumber : id.getEnterpriseNumber();
                StructuredDataId mdcSDID = new StructuredDataId(mdcId, ein, null, null);
                formatStructuredElement(mdcSDID, event.getContextMap(), buf, checker);
            }
            if (text != null && text.length() > 0) {
                buf.append(" ").append(text);
            }
View Full Code Here

    }

    protected void addStructuredData(final String prefix, final Map<String, String> fields,
                                     final StructuredDataMessage msg) {
        fields.put(prefix + EVENT_TYPE, msg.getType());
        final StructuredDataId id = msg.getId();
        fields.put(prefix + EVENT_ID, id.getName());
    }
View Full Code Here

        addGuid(headers);
    }

    protected void addStructuredData(String prefix, Map<String, String> fields, StructuredDataMessage msg) {
        fields.put(prefix + EVENT_TYPE, msg.getType());
        StructuredDataId id = msg.getId();
        fields.put(prefix + EVENT_ID, id.getName());
    }
View Full Code Here

        } else {
            buf.append("-");
        }
        buf.append(" ");
        if (isStructured || includeMDC) {
            StructuredDataId id = null;
            String text;
            if (isStructured) {
                final StructuredDataMessage data = (StructuredDataMessage) msg;
                final Map<String, String> map = data.getData();
                id = data.getId();
                formatStructuredElement(id, map, buf, noopChecker);
                text = data.getFormat();
            } else {
                text = msg.getFormattedMessage();
            }
            if (includeMDC) {
                if (mdcRequired != null) {
                    checkRequired(event.getContextMap());
                }
                final int ein = id == null || id.getEnterpriseNumber() < 0 ?
                    enterpriseNumber : id.getEnterpriseNumber();
                final StructuredDataId mdcSDID = new StructuredDataId(mdcId, ein, null, null);
                formatStructuredElement(mdcSDID, event.getContextMap(), buf, checker);
            }
            if (text != null && text.length() > 0) {
                buf.append(" ").append(escapeNewlines(text, escapeNewLine));
            }
View Full Code Here

    }

    protected void addStructuredData(final String prefix, final Map<String, String> fields,
                                     final StructuredDataMessage msg) {
        fields.put(prefix + EVENT_TYPE, msg.getType());
        final StructuredDataId id = msg.getId();
        fields.put(prefix + EVENT_ID, id.getName());
    }
View Full Code Here

        } else {
            buf.append("-");
        }
        buf.append(" ");
        if (isStructured || includeMDC) {
            StructuredDataId id = null;
            String text;
            if (isStructured) {
                StructuredDataMessage data = (StructuredDataMessage) msg;
                Map map = data.getData();
                id = data.getId();
                formatStructuredElement(id, map, buf, noopChecker);
                text = data.getFormat();
            } else {
                text = msg.getFormattedMessage();
            }
            if (includeMDC) {
                if (mdcRequired != null) {
                    checkRequired(event.getContextMap());
                }
                int ein = id == null || id.getEnterpriseNumber() < 0 ? enterpriseNumber : id.getEnterpriseNumber();
                StructuredDataId mdcSDID = new StructuredDataId(mdcId, ein, null, null);
                formatStructuredElement(mdcSDID, event.getContextMap(), buf, checker);
            }
            if (text != null && text.length() > 0) {
                buf.append(" ").append(text);
            }
View Full Code Here

        } else {
            buf.append("-");
        }
        buf.append(" ");
        if (isStructured || includeMDC) {
            StructuredDataId id = null;
            String text;
            if (isStructured) {
                final StructuredDataMessage data = (StructuredDataMessage) msg;
                final Map<String, String> map = data.getData();
                id = data.getId();
                formatStructuredElement(id, eventPrefix, map, buf, noopChecker);
                text = data.getFormat();
            } else {
                text = msg.getFormattedMessage();
            }
            if (includeMDC) {
                Map<String, String> map = event.getContextMap();
                if (mdcRequired != null) {
                    checkRequired(map);
                }
                final int ein = id == null || id.getEnterpriseNumber() < 0 ?
                    enterpriseNumber : id.getEnterpriseNumber();
                final StructuredDataId mdcSDID = new StructuredDataId(mdcId, ein, null, null);
                if (fieldFormatters != null) {
                    map = new HashMap<String, String>(map);
                    for (final Map.Entry<String, List<PatternFormatter>> entry : fieldFormatters.entrySet()) {
                        final StringBuilder value = new StringBuilder();
                        for (final PatternFormatter formatter : entry.getValue()) {
View Full Code Here

TOP

Related Classes of org.apache.logging.log4j.message.StructuredDataId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.