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

com.sap.hcp.cf.logging.sample.springboot.statistics.StatisticsContextFieldSupplier Maven / Gradle / Ivy

package com.sap.hcp.cf.logging.sample.springboot.statistics;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;

import com.sap.hcp.cf.logging.common.serialization.ContextFieldSupplier;

public class StatisticsContextFieldSupplier implements ContextFieldSupplier {

	private static final String KEY = "message_count";

	private static AtomicLong count = new AtomicLong();

	@SuppressWarnings("serial")
	@Override
	public Map get() {
		return new HashMap() {
			{
				put(KEY, count.incrementAndGet());
			}
		};
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy