All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.hcp.cf.log4j2.converter.TimestampConverter Maven / Gradle / Ivy

There is a newer version: 3.8.4
Show newest version
package com.sap.hcp.cf.log4j2.converter;

import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.pattern.ConverterKeys;
import org.apache.logging.log4j.core.pattern.LogEventPatternConverter;

@Plugin(name = "TimestampConverter", category = "Converter")
@ConverterKeys({ "tstamp" })
public class TimestampConverter extends LogEventPatternConverter {

    public static final String WORD = "tstamp";

    public TimestampConverter(String[] options) {
        super(WORD, WORD);
    }

    public static TimestampConverter newInstance(final String[] options) {
        return new TimestampConverter(options);
    }

    @Override
    public void format(LogEvent event, StringBuilder toAppendTo) {
        toAppendTo.append(System.nanoTime());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy