// Path: src/org/restsql/service/monitoring/MonitoringFactory.java
// public class MonitoringFactory extends AbstractFactory {
// 	
// 	/** Returns MonitoringManager singleton. */
// 	public static MonitoringManager getMonitoringManager() {
// 		return (MonitoringManager) getInstance(Config.KEY_MONITORING_MANAGER, Config.DEFAULT_MONITORING_MANAGER);
// 	}
// 
// 	/** Returns configured MonitoringManager class name. */
// 	public static String getMonitoringManagerClass() {
// 		return Config.properties.getProperty(Config.KEY_MONITORING_MANAGER, Config.DEFAULT_MONITORING_MANAGER);
// 	}
// 
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.restsql.core.Config;
import org.restsql.service.monitoring.MonitoringFactory;
import com.codahale.metrics.Counter;
/* Copyright (c) restSQL Project Contributors. Licensed under MIT. */
package org.restsql.service;





/**
 * Provides access to logs.
 * 
 * @author Mark Sawers
 */
@Path("log")
public class LogResource {
	private static final String LOG_NAME_ACCESS = "access.log";
	private static final String LOG_NAME_ERROR = "error.log";
	private static final String LOG_NAME_INTERNAL = "internal.log";
	private static final String LOG_NAME_TRACE = "trace.log";
	
// Path: src/org/restsql/service/monitoring/MonitoringFactory.java
// public class MonitoringFactory extends AbstractFactory {
// 	
// 	/** Returns MonitoringManager singleton. */
// 	public static MonitoringManager getMonitoringManager() {
// 		return (MonitoringManager) getInstance(Config.KEY_MONITORING_MANAGER, Config.DEFAULT_MONITORING_MANAGER);
// 	}
// 
// 	/** Returns configured MonitoringManager class name. */
// 	public static String getMonitoringManagerClass() {
// 		return Config.properties.getProperty(Config.KEY_MONITORING_MANAGER, Config.DEFAULT_MONITORING_MANAGER);
// 	}
// 
// }


// Path: src/org/restsql/service/LogResource.java
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.restsql.core.Config;
import org.restsql.service.monitoring.MonitoringFactory;
import com.codahale.metrics.Counter;

/* Copyright (c) restSQL Project Contributors. Licensed under MIT. */
package org.restsql.service;





/**
 * Provides access to logs.
 * 
 * @author Mark Sawers
 */
@Path("log")
public class LogResource {
	private static final String LOG_NAME_ACCESS = "access.log";
	private static final String LOG_NAME_ERROR = "error.log";
	private static final String LOG_NAME_INTERNAL = "internal.log";
	private static final String LOG_NAME_TRACE = "trace.log";
	
	private final Counter logAccessCounter = MonitoringFactory.getMonitoringManager().newCounter(LogResource.class, "logAccess");
