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

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

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

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;

/**
 * This is a simple {@link ClassicConverter} implementation that print the
 * timestamp as a long in nano second resolution.
 */
public class TimestampConverter extends ClassicConverter {

    public static final String WORD = "tstamp";

    @Override
    public String convert(ILoggingEvent event) {
        StringBuilder appendTo = new StringBuilder();
        appendTo.append(System.currentTimeMillis() * 1000000);
        return appendTo.toString();
    }

    @Override
    public void start() {
        super.start();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy