Skip to content
Permalink
Browse files

Fixed

  • Loading branch information
Ian Emmons
Ian Emmons committed Jul 11, 2019
1 parent ddc325b commit d8b1f19e60c6deb04937b9052efcfd22627a81ef
@@ -355,9 +355,14 @@ \subsubsection{\acp{pmnt} Main Configuration File}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{\acp{pmnt} Logging Configuration}
The file \path|ParliamentKB/conf/log4j.properties| configures logging for \acp{pmnt} Java code. This is a standard Log4J configuration file.
These files configure logging for \acp{pmnt} Java code:
\begin{quote}
\path|ParliamentKB/conf/log4j.interactive.properties|\\
\path|ParliamentKB/conf/log4j.daemon.properties|
\end{quote}
They are standard Log4J configuration files. The first applies when running \ac{pmnt} from the command line, and the second is used when running as a daemon or service.
The file \path|ParliamentLogConfig.txt| controls \acp{pmnt} native code logging. Its format is similar to \path|ParliamentKbConfig.txt|. \ac{pmnt} also locates it in a similar way, using file name \path|ParliamentLogConfig.txt| and the environment variable \verb|PARLIAMENT_LOG_CONFIG_PATH|. The recognized settings are:
The file \path|ParliamentLogConfig.txt| controls native code logging. Its format is similar to \path|ParliamentKbConfig.txt|, and it is located in a similar way, using file name \path|ParliamentLogConfig.txt| and the environment variable \verb|PARLIAMENT_LOG_CONFIG_PATH|. The recognized settings are:
\begin{description}
\item[logToConsole] Indicates whether to log to the console. \emph{Default: ``yes''}
Binary file not shown.
@@ -146,7 +146,7 @@
<fileset dir="${configDir}">
<include name="jetty.xml"/>
<include name="webdefault.xml"/>
<include name="log4j.properties"/>
<include name="log4j.*.properties"/>
</fileset>
</copy>

@@ -0,0 +1,40 @@
log4j.rootLogger=INFO, file

log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=log/parliament.log
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%c] %m%n

# Joseki server logging
log4j.logger.org.mortbay=WARN
log4j.logger.org.joseki=WARN
#log4j.logger.org.joseki.server.http.LocatorServletContext=ALL

# Jena logging, including the Joseki client
log4j.logger.com.hp.hpl.jena=WARN
#log4j.logger.com.hp.hpl.jena.util.FileManager=ALL
#log4j.logger.com.hp.hpl.jena.util.LocationMapper=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorClassLoader=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorFile=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorURL=ALL

# BBN logging
log4j.logger.com.bbn=INFO
#log4j.logger.com.bbn.parliament.jena.extensions=ALL
#log4j.logger.com.bbn.parliament.jena.graph.index.spatial=ALL
#log4j.logger.com.bbn.parliament.jena.graph.index.temporal.extent=ALL
#log4j.logger.com.bbn.parliament.jena.graph.index.temporal=ALL
#log4j.logger.com.bbn.parliament.jena.graph.KbGraphStore=ALL
#log4j.logger.com.bbn.parliament.jena.graph.union.KbUnionGraphTest=ALL
#log4j.logger.com.bbn.parliament.jena.graph=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.bridge.servlet.ParliamentRequest=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.bridge.servlet.XSLTFilter=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.graph.ModelManager=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.josekibridge.QueryExecutionTracker=ALL
#log4j.logger.com.bbn.parliament.jena.query.AbstractDAWGTestCase=ALL
#log4j.logger.com.bbn.parliament.jena.util=ALL
#log4j.logger.=ALL

# Un-comment this to see queries and updates (generates lots of output!!):
#log4j.logger.com.bbn.parliament.jena.joseki.bridge.SparqlStmtLogger=ALL
@@ -2,18 +2,14 @@ log4j.rootLogger=INFO, stdout, file

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# A useful default pattern:
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%c] %m%n

# This pattern adds method name and line number, but it's slow, so don't use in production
#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%l] %m%n
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%l] %m%n
log4j.appender.stdout.Target=System.out

log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=log/parliament.log
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%c] %m%n
log4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%l] %m%n

# Joseki server logging
log4j.logger.org.mortbay=WARN
@@ -23,20 +19,27 @@ log4j.logger.org.joseki=WARN
# Jena logging, including the Joseki client
log4j.logger.com.hp.hpl.jena=WARN
#log4j.logger.com.hp.hpl.jena.util.FileManager=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorURL=ALL
#log4j.logger.com.hp.hpl.jena.util.LocationMapper=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorClassLoader=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorFile=ALL
#log4j.logger.com.hp.hpl.jena.util.LocationMapper=ALL
#log4j.logger.com.hp.hpl.jena.util.LocatorURL=ALL

# BBN logging
log4j.logger.com.bbn=INFO
#log4j.logger.com.bbn.parliament.jena.graph=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.graph.ModelManager=ALL
#log4j.logger.com.bbn.parliament.jena.graph.KbGraphStore=ALL
#log4j.logger.com.bbn.parliament.jena.extensions=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.josekibridge.QueryExecutionTracker=ALL
#log4j.logger.com.bbn.parliament.jena.graph.index.spatial=ALL
#log4j.logger.com.bbn.parliament.jena.graph.index.temporal.extent=ALL
#log4j.logger.com.bbn.parliament.jena.graph.index.temporal=ALL
#log4j.logger.com.bbn.parliament.jena.graph.KbGraphStore=ALL
#log4j.logger.com.bbn.parliament.jena.graph.union.KbUnionGraphTest=ALL
#log4j.logger.com.bbn.parliament.jena.graph=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.bridge.servlet.ParliamentRequest=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.bridge.servlet.XSLTFilter=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.graph.ModelManager=ALL
#log4j.logger.com.bbn.parliament.jena.joseki.josekibridge.QueryExecutionTracker=ALL
#log4j.logger.com.bbn.parliament.jena.query.AbstractDAWGTestCase=ALL
#log4j.logger.com.bbn.parliament.jena.util=ALL
#log4j.logger.=ALL

# Un-comment this to see queries and updates (generates lots of output!!):
#log4j.logger.com.bbn.parliament.jena.joseki.bridge.SparqlStmtLogger=ALL
@@ -33,7 +33,7 @@ done
export LD_LIBRARY_PATH=./bin:$LD_LIBRARY_PATH

EXEC="java -server -Xms$MIN_MEM -Xmx$MAX_MEM -cp $CP -Djava.library.path=./bin"
EXEC="$EXEC -Dcom.sun.management.jmxremote -Dlog4j.configuration=conf/log4j.properties"
EXEC="$EXEC -Dcom.sun.management.jmxremote -Dlog4j.configuration=conf/log4j.interactive.properties"
EXEC="$EXEC -Djetty.host=$JETTY_HOST -Djetty.port=$JETTY_PORT"
# Uncomment this line to enable remote debugging:
#EXEC="$EXEC $DEBUG_ARG"
@@ -96,7 +96,7 @@ else
fi

EXEC_MID="-Xms$MIN_MEM -Xmx$MAX_MEM -cp $CP -Djava.library.path=$PMNT_DIR/bin"
EXEC_MID="$EXEC_MID -Dcom.sun.management.jmxremote -Dlog4j.configuration=conf/log4j.properties"
EXEC_MID="$EXEC_MID -Dcom.sun.management.jmxremote -Dlog4j.configuration=conf/log4j.daemon.properties"
EXEC_MID="$EXEC_MID -Djetty.host=$JETTY_HOST -Djetty.port=$JETTY_PORT"
EXEC_MID="$EXEC_MID -DjettyConfig=$PMNT_DIR/conf/jetty.xml"
if [ -n "$DEBUG_ARG" ]; then
@@ -53,7 +53,7 @@ set EXEC=%EXEC% --LibraryPath "%KBROOT%bin"
set EXEC=%EXEC% --Jvm "%JVM_DLL%" --JvmMs "%MIN_MEM%" --JvmMx "%MAX_MEM%"
set EXEC=%EXEC% --Classpath "%LCP%"
set EXEC=%EXEC% --JvmOptions -Dcom.sun.management.jmxremote
set EXEC=%EXEC% ++JvmOptions -Dlog4j.configuration=conf/log4j.properties
set EXEC=%EXEC% ++JvmOptions -Dlog4j.configuration=conf/log4j.daemon.properties
set EXEC=%EXEC% ++JvmOptions -Djetty.host=%JETTY_HOST%
set EXEC=%EXEC% ++JvmOptions -Djetty.port=%JETTY_PORT%
set EXEC=%EXEC% --Startup auto --StartPath "%KBROOT%."
@@ -41,7 +41,7 @@ set EXEC=java -server -Xms%MIN_MEM% -Xmx%MAX_MEM% -cp "%LCP%"
rem Uncomment this line to enable remote debugging:
rem set EXEC=%EXEC% %DEBUG_ARG%
set EXEC=%EXEC% -Dcom.sun.management.jmxremote
set EXEC=%EXEC% -Dlog4j.configuration="conf/log4j.properties"
set EXEC=%EXEC% -Dlog4j.configuration="conf/log4j.interactive.properties"
set EXEC=%EXEC% -Djetty.host=%JETTY_HOST% -Djetty.port=%JETTY_PORT%
set EXEC=%EXEC% -Djava.library.path="%KBROOT%bin"
set EXEC=%EXEC% com.bbn.parliament.jena.jetty.CmdLineJettyServer
@@ -13,7 +13,7 @@
import org.slf4j.LoggerFactory;

public class CmdLineJettyServer {
private static Logger _log = LoggerFactory.getLogger(CmdLineJettyServer.class);
private static final Logger LOG = LoggerFactory.getLogger(CmdLineJettyServer.class);

/** Default entry point. */
public static void main(String[] args) {
@@ -23,7 +23,7 @@ public static void main(String[] args) {
monitor.start();
JettyServerCore.getInstance().start();
} catch (Exception ex) {
_log.error("Parliament server encountered an exception", ex);
LOG.error("Parliament server encountered an exception", ex);
}
}

@@ -16,7 +16,7 @@
* @author iemmons
*/
public class JettyDaemon {
private static Logger _log = LoggerFactory.getLogger(JettyDaemon.class);
private static final Logger LOG = LoggerFactory.getLogger(JettyDaemon.class);

/**
* Initialize the daemon, possibly running as super-user. E.g., open
@@ -26,35 +26,35 @@
@SuppressWarnings("static-method")
public void init(String[] args) {
try {
_log.info("Initializing Jetty Daemon");
LOG.info("Initializing Jetty Daemon");
JettyServerCore.initialize();
} catch (JettyServerCore.InitException ex) {
_log.error("Parliament server encountered an exception", ex);
} catch (ServerInitException ex) {
LOG.error("Parliament server encountered an exception", ex);
}
}

/** Start the server running */
@SuppressWarnings("static-method")
public void start() {
try {
_log.info("Starting Jetty Daemon");
LOG.info("Starting Jetty Daemon");
JettyServerCore.getInstance().start();
} catch (Exception ex) {
_log.error("Parliament server encountered an exception", ex);
LOG.error("Parliament server encountered an exception", ex);
}
}

/** Tell the server to terminate */
@SuppressWarnings("static-method")
public void stop() {
_log.info("Stopping Jetty Daemon");
LOG.info("Stopping Jetty Daemon");
JettyServerCore.getInstance().stop();
}

/** Cleanup resources allocated in init() */
@SuppressWarnings("static-method")
public void destroy() {
_log.info("Destroying Jetty Daemon");
LOG.info("Destroying Jetty Daemon");
// Do nothing
}
}

0 comments on commit d8b1f19

Please sign in to comment.
You can’t perform that action at this time.