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

io.antmedia.logger.LoggerUtils Maven / Gradle / Ivy

Go to download

Ant Media Server supports RTMP, RTSP, MP4, HLS, WebRTC, Adaptive Streaming, etc.

There is a newer version: 2.11.3
Show newest version
package io.antmedia.logger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

import io.antmedia.analytic.model.AnalyticEvent;



public class LoggerUtils {

	static Gson gson = new Gson();

	private static final Logger analyticsLogger = LoggerFactory.getLogger("analytics");


	private LoggerUtils() {
		//Hide public constructor
	}

	public static void logAnalyticsFromClient(AnalyticEvent event) {
		event.setLogSource(AnalyticEvent.LOG_SOURCE_CLIENT);
		if (analyticsLogger.isInfoEnabled()) {
			analyticsLogger.info(gson.toJson(event));
		}

	}


	public static void logAnalyticsFromServer(AnalyticEvent event) {
		event.setLogSource(AnalyticEvent.LOG_SOURCE_SERVER);
		if (analyticsLogger.isInfoEnabled()) {
			analyticsLogger.info(gson.toJson(event));
		}
		
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy