diff --git a/ccm-core/lib/log4j-1.2-api-2.8.2.jar b/ccm-core/lib/log4j-1.2-api-2.8.2.jar new file mode 100644 index 000000000..a9c13b2f3 Binary files /dev/null and b/ccm-core/lib/log4j-1.2-api-2.8.2.jar differ diff --git a/ccm-core/lib/log4j-api-2.8.2.jar b/ccm-core/lib/log4j-api-2.8.2.jar new file mode 100644 index 000000000..9694c29f0 Binary files /dev/null and b/ccm-core/lib/log4j-api-2.8.2.jar differ diff --git a/ccm-core/lib/log4j-core-2.8.2.jar b/ccm-core/lib/log4j-core-2.8.2.jar new file mode 100644 index 000000000..eb658af8b Binary files /dev/null and b/ccm-core/lib/log4j-core-2.8.2.jar differ diff --git a/ccm-core/lib/log4j.jar b/ccm-core/lib/log4j.jar deleted file mode 100755 index 493a3ccc1..000000000 Binary files a/ccm-core/lib/log4j.jar and /dev/null differ diff --git a/ccm-core/src/com/arsdigita/logging/ErrorReport.java b/ccm-core/src/com/arsdigita/logging/ErrorReport.java index fec82bb10..d759417ac 100755 --- a/ccm-core/src/com/arsdigita/logging/ErrorReport.java +++ b/ccm-core/src/com/arsdigita/logging/ErrorReport.java @@ -88,8 +88,8 @@ public class ErrorReport { file.mkdir(); } - ErrorReportAppender appender = new ErrorReportAppender(directory); - s_log.addAppender(appender); + //ErrorReportAppender appender = new ErrorReportAppender(directory); + //s_log.addAppender(appender); } private Throwable[] m_throwables; diff --git a/ccm-core/src/com/arsdigita/logging/ErrorReportAppender.java b/ccm-core/src/com/arsdigita/logging/ErrorReportAppender.java deleted file mode 100755 index 0d074ea86..000000000 --- a/ccm-core/src/com/arsdigita/logging/ErrorReportAppender.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.logging; - - -import org.apache.log4j.FileAppender; -import org.apache.log4j.Layout; -import org.apache.log4j.spi.LoggingEvent; - - -public class ErrorReportAppender extends FileAppender { - - private String m_directory; - - public ErrorReportAppender(String directory) { - m_directory = directory; - - setLayout(new Layout() { - public void activateOptions() {} - public boolean ignoresThrowable() { return true; } - - public String format(LoggingEvent event) { - return ((ErrorReport)event.getMessage()).getReport(); - } - }); - setName("ErrorReportAppender"); - } - - public void append(LoggingEvent event) { - if (event.getMessage() instanceof ErrorReport) { - ErrorReport report = (ErrorReport)event.getMessage(); - - setFile(m_directory + "/" + report.getGuruMeditationCode() + ".txt"); - setAppend(false); - setBufferedIO(false); - activateOptions(); - - super.append(event); - } - } - -} diff --git a/ccm-core/src/com/arsdigita/logging/Log.java b/ccm-core/src/com/arsdigita/logging/Log.java deleted file mode 100755 index 0ae752110..000000000 --- a/ccm-core/src/com/arsdigita/logging/Log.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.logging; - -/** - *
- * Defines APIs for logging in addition to those supplied by log4j. - * Mainly, this class defines an API for logging securely. - *
- * - * @author Yon Feldman - * @version $Id: Log.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class Log { - - // this variable will hold the secure state for this class on a per thread - // basis. - private static ThreadLocal s_secureState = new ThreadLocal() { - public Object initialValue() { - return Boolean.FALSE; - } - }; - - /** - * Checks whether we are currently logging securely. - * - * @returntrue if we are logging securely, false otherwise.
- */
- public static boolean isSecure() {
- return ((Boolean) s_secureState.get()).booleanValue();
- }
-
- // begin logging securely.
- private static void startSecureLogging() {
- s_secureState.set(Boolean.TRUE);
- }
-
- // reset the secure logging state to the value passed in.
- private static void resetSecureLogging(Boolean inSecureState) {
- s_secureState.set(inSecureState);
- }
-
- /**
- * Any log messages run inside this method will be logged securely.
- *
- * @param r the class that implements the Runnable interface
- */
- public static void secure (Runnable r) {
- // store old value so that we can reset to the appropriate value when
- // done.
- boolean inSecureState = isSecure();
-
- // start logging securely
- startSecureLogging();
-
- // run code
- r.run();
-
- // reset logging state
- resetSecureLogging(new Boolean(inSecureState));
- }
-}
diff --git a/ccm-core/src/com/arsdigita/logging/SecureLogFilter.java b/ccm-core/src/com/arsdigita/logging/SecureLogFilter.java
deleted file mode 100755
index 09b2b1ec0..000000000
--- a/ccm-core/src/com/arsdigita/logging/SecureLogFilter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved.
- *
- * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
-package com.arsdigita.logging;
-
-import org.apache.log4j.spi.Filter;
-import org.apache.log4j.spi.LoggingEvent;
-
-/**
- * - * Defines a log4j filter that will filter out any messages that - * are tagged as secure by the Log class. - *
- * - * @author Yon Feldman - * @version $Id: SecureLogFilter.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class SecureLogFilter extends Filter { - /** - * Decides whether to let this log message go through. - * - * @param event a LoggingEvent to decide about letting go through - */ - public int decide(LoggingEvent event) { - // in here we have to check whether secure logging is on or off. - if(Log.isSecure()) - return Filter.DENY; - return Filter.NEUTRAL; - } - - /** - * Filter that does not support any options. - */ - public String[] getOptionStrings() { - return new String[] {"", ""}; - } - - /** - * Filter that does not support any options. - */ - public void setOption(String key, String value) {} -} diff --git a/ccm-core/src/com/arsdigita/logging/examples/LogExample.java b/ccm-core/src/com/arsdigita/logging/examples/LogExample.java deleted file mode 100755 index 42aa63972..000000000 --- a/ccm-core/src/com/arsdigita/logging/examples/LogExample.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.logging.examples; - -import com.arsdigita.logging.Log; -import com.arsdigita.logging.SecureLogFilter; -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.Logger; -import org.apache.log4j.PatternLayout; -import org.apache.log4j.RollingFileAppender; - -/** - *- * This is an example class that uses the secure logging api. - *
- * - * @version $Id: LogExample.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class LogExample { - - // get the logger named the same as this class - static final Logger cat = Logger.getLogger(LogExample.class); - - private static void configureNewAppender(String filename) { - // try to add an appender that sends log output to - // the file passed in as the first argument to this program - // but only output that is not marked as secure - try { - // create a rolling file appender with standard layout - RollingFileAppender rfa = new RollingFileAppender( - new PatternLayout( - PatternLayout.TTCC_CONVERSION_PATTERN - ), filename - ); - - // add our secure log filter to this appender so that it - // won't get any of the secure log messages - rfa.addFilter(new SecureLogFilter()) ; - - // add this appender to the root category. - BasicConfigurator.configure(rfa); - } catch (java.io.IOException e) { - // we should error out here really but who cares for now - } - } - - public static void main(String[] argv) { - // lets just use the basic configuration - BasicConfigurator.configure(); - - int iterations = 3; - switch(argv.length) { - case 0: - break; - case 1: - configureNewAppender(argv[0]); - break; - case 2: - configureNewAppender(argv[0]); - iterations = Integer.parseInt(argv[1]); - break; - default: - String s = System.getProperty("line.separator"); - System.out.println( - "Usage:" + s + - "java " + LogExample.class.getName() + s + - "java " + LogExample.class.getName() + - "- * This is a helper class to the example class LogExampleThread - *
- * - * @version $Id: LogExampleThread.java 287 2005-02-22 00:29:02Z sskracic $ - */ -public class LogExampleThread extends Thread { - - // get the category named the same as this class - private static final Logger cat = Logger.getLogger(LogExampleThread.class); - - public void run() { - Log.secure(new Runnable() { - public void run() { - try { - sleep((new Double(Math.random() * 100.0)).intValue()); - } catch (InterruptedException e) { - // do nothing - return; - } - - // do everything that needs to be logged securely here - if(Log.isSecure()) - cat.info( - "We are running securely in thread " + - Thread.currentThread().getName() + - ". There are " + - Thread.currentThread().activeCount() + - " threads currently running." - ); - else - cat.info( - "We are not running securely in thread " + - Thread.currentThread().getName() + - ". There are " + - Thread.currentThread().activeCount() + - " threads currently running." - ); - } - }); - } -} diff --git a/ccm-core/src/com/arsdigita/logging/examples/package.html b/ccm-core/src/com/arsdigita/logging/examples/package.html deleted file mode 100755 index fbc2dc88b..000000000 --- a/ccm-core/src/com/arsdigita/logging/examples/package.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -Contains example code to demonstrate proper usage of -the ACS Logging system.
- - - - - diff --git a/ccm-ldn-terms/src/com/arsdigita/london/terms/util/ApplyTemplates.java b/ccm-ldn-terms/src/com/arsdigita/london/terms/util/ApplyTemplates.java index ff93cdc0b..8de181ef3 100755 --- a/ccm-ldn-terms/src/com/arsdigita/london/terms/util/ApplyTemplates.java +++ b/ccm-ldn-terms/src/com/arsdigita/london/terms/util/ApplyTemplates.java @@ -36,7 +36,7 @@ import java.util.Date; import java.util.Map; import java.util.HashMap; -import org.apache.log4j.ConsoleAppender; +//import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.BasicConfigurator; @@ -87,11 +87,11 @@ public class ApplyTemplates { public static void main(String[] args) { /* Setup logger */ - ConsoleAppender log = new ConsoleAppender( - new PatternLayout( - "%d{ISO8601} [%5.5t] %-5p %c{2} - %m%n")); - log.setThreshold(Level.toLevel("warn")); - BasicConfigurator.configure(log); + //ConsoleAppender log = new ConsoleAppender( + // new PatternLayout( + // "%d{ISO8601} [%5.5t] %-5p %c{2} - %m%n")); + //log.setThreshold(Level.toLevel("warn")); + //BasicConfigurator.configure(log); /* Process command line options and parameter */ @@ -102,7 +102,7 @@ public class ApplyTemplates { String input = args[1]; String output = args[2]; - log.setThreshold(Level.toLevel((String)options.get(OPT_LOG))); + //log.setThreshold(Level.toLevel((String)options.get(OPT_LOG))); s_log.debug("Build xml source " + new Date()); StreamSource xml = new StreamSource(input);