<commit_before>/*
 * /////////////////////////////////////////////////////////////////////////////
 * // This file is part of the "Hyrax Data Server" project.
 * //
 * //
 * // Copyright (c) 2013 OPeNDAP, Inc.
 * // Author: <NAME>  <<EMAIL>>
 * //
 * // This library is free software; you can redistribute it and/or
 * // modify it under the terms of the GNU Lesser General Public
 * // License as published by the Free Software Foundation; either
 * // version 2.1 of the License, or (at your option) any later version.
 * //
 * // This library is distributed in the hope that it will be useful,
 * // but WITHOUT ANY WARRANTY; without even the implied warranty of
 * // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * // Lesser General Public License for more details.
 * //
 * // You should have received a copy of the GNU Lesser General Public
 * // License along with this library; if not, write to the Free Software
 * // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 * //
 * // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
 * /////////////////////////////////////////////////////////////////////////////
 */

package opendap.logging;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.util.StatusPrinter;
import opendap.coreServlet.ServletUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;


/**
 * User: ndp
 * Date: Feb 6, 2007
 * Time: 3:34:35 PM
 */
public class LogUtil {

    public static final String HYRAX_ACCESS_LOG_ID = "HyraxAccess";
    public static final String HYRAX_LAST_MODIFIED_ACCESS_LOG_ID = "HyraxLastModifiedAccess";

    public static final String DOCS_ACCESS_LOG_ID = "DocsAccess";

    public static final String SITEMAP_ACCESS_LOG_ID = "SiteMapAccess";

    public static final String PDP_SERVICE_ACCESS_LOG_ID = "PDPServiceAccess";
    public static final String PDP_SERVICE_LAST_MODIFIED_LOG_ID = "PDPServiceLastModifiedAccess";

    public static final String GATEWAY_ACCESS_LOG_ID = "HyraxGatewayAccess";
    public static final String GATEWAY_ACCESS_LAST_MODIFIED_LOG_ID = "HyraxGatewayLastModifiedAccess";

    public static final String ADMIN_ACCESS_LOG_ID = "HyraxAdminAccess";
    public static final String ADMIN_ACCESS_LAST_MODIFIED_LOG_ID = "HyraxAdminLastModifiedAccess";

    public static final String S3_SERVICE_ACCESS_LOG_ID = "S3ServiceAccess";
    public static final String S3_SERVICE_LAST_MODIFIED_LOG_ID = "S3ServiceLastModifiedAccess";

    public static final String WCS_ACCESS_LOG_ID = "WCSAccess";
    public static final String WCS_LAST_MODIFIED_ACCESS_LOG_ID = "WCSLastModifiedAccess";

    private static final String ID_KEY = "ID";
    private static final String SOURCE_KEY = "SOURCE";
    private static final String HOST_KEY = "host";
    private static final String IDENT_KEY = "ident";
    private static final String USER_ID_KEY = "userid";
    private static final String USER_AGENT_KEY = "UserAgent";
    private static final String START_TIME_KEY = "startTime";
    private static final String RESOURCE_ID_KEY = "resourceID";
    private static final String QUERY_STRING_KEY = "query";
    private static final String RESPONSE_SIZE_KEY = "size";
    private static final String DURATION_KEY = "duration";
    private static final String HTTP_STATUS_KEY = "http_status";<commit_msg>Added ngap service end-point<commit_after>/*
 * /////////////////////////////////////////////////////////////////////////////
 * // This file is part of the "Hyrax Data Server" project.
 * //
 * //
 * // Copyright (c) 2013 OPeNDAP, Inc.
 * // Author: <NAME>  <<EMAIL>>
 * //
 * // This library is free software; you can redistribute it and/or
 * // modify it under the terms of the GNU Lesser General Public
 * // License as published by the Free Software Foundation; either
 * // version 2.1 of the License, or (at your option) any later version.
 * //
 * // This library is distributed in the hope that it will be useful,
 * // but WITHOUT ANY WARRANTY; without even the implied warranty of
 * // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * // Lesser General Public License for more details.
 * //
 * // You should have received a copy of the GNU Lesser General Public
 * // License along with this library; if not, write to the Free Software
 * // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 * //
 * // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
 * /////////////////////////////////////////////////////////////////////////////
 */

package opendap.logging;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.util.StatusPrinter;
import opendap.coreServlet.ServletUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;


/**
 * User: ndp
 * Date: Feb 6, 2007
 * Time: 3:34:35 PM
 */
public class LogUtil {

    public static final String HYRAX_ACCESS_LOG_ID = "HyraxAccess";
    public static final String HYRAX_LAST_MODIFIED_ACCESS_LOG_ID = "HyraxLastModifiedAccess";

    public static final String DOCS_ACCESS_LOG_ID = "DocsAccess";

    public static final String SITEMAP_ACCESS_LOG_ID = "SiteMapAccess";

    public static final String PDP_SERVICE_ACCESS_LOG_ID = "PDPServiceAccess";
    public static final String PDP_SERVICE_LAST_MODIFIED_LOG_ID = "PDPServiceLastModifiedAccess";

    public static final String GATEWAY_ACCESS_LOG_ID = "HyraxGatewayAccess";
    public static final String GATEWAY_ACCESS_LAST_MODIFIED_LOG_ID = "HyraxGatewayLastModifiedAccess";

    public static final String ADMIN_ACCESS_LOG_ID = "HyraxAdminAccess";
    public static final String ADMIN_ACCESS_LAST_MODIFIED_LOG_ID = "HyraxAdminLastModifiedAccess";

    public static final String S3_SERVICE_ACCESS_LOG_ID = "S3ServiceAccess";
    public static final String S3_SERVICE_LAST_MODIFIED_LOG_ID = "S3ServiceLastModifiedAccess";

    public static final String WCS_ACCESS_LOG_ID = "WCSAccess";
    public static final String WCS_LAST_MODIFIED_ACCESS_LOG_ID = "WCSLastModifiedAccess";

    public static final String NGAP_ACCESS_LOG_ID = "HyraxNGAPAccess";
    public static final String NGAP_ACCESS_LAST_MODIFIED_LOG_ID = "HyraxNGAPLastModifiedAccess";

    private static final String ID_KEY = "ID";
    private static final String SOURCE_KEY = "SOURCE";
    private static final String HOST_KEY = "host";
    private static final String IDENT_KEY = "ident";
    private static final String USER_ID_KEY = "userid";
    private static final String USER_AGENT_KEY = "UserAgent";
    private static final String START_TIME_KEY = "startTime";
    private static final String RESOURCE_ID_KEY = "resourceID";
    private static final String QUERY_STRING_KEY = "query";
    private static final String RESPONSE_SIZE_KEY = "size";
    private static final String DURATION_KEY = "duration";
    private static final String HTTP_STATUS_KEY = "http_status";
{'fraction_non_alphanumeric': 0.1179989816700611, 'fraction_numerical': 0.011710794297352342, 'mean_word_length': 3.5840140023337224, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5303204', 'n_tokens_mistral': 2350, 'n_tokens_neox': 2250, 'n_words': 714}