Index: main/project.xml
===================================================================
--- main/project.xml (revision 201825)
+++ main/project.xml (working copy)
@@ -148,8 +148,13 @@
1.2.1
http://www.springframework.com/
+
+ log4j
+ log4j
+ 1.2.8
+
+
-
maven-changes-plugin
maven-tasklist-plugin
Index: main/maven.xml
===================================================================
--- main/maven.xml (revision 201825)
+++ main/maven.xml (working copy)
@@ -11,6 +11,10 @@
+
+
+
+
Index: main/src/main/java/org/apache/ldap/server/ServerMain.java
===================================================================
--- main/src/main/java/org/apache/ldap/server/ServerMain.java (revision 201825)
+++ main/src/main/java/org/apache/ldap/server/ServerMain.java (working copy)
@@ -26,6 +26,7 @@
import org.apache.ldap.server.configuration.ServerStartupConfiguration;
import org.apache.ldap.server.configuration.SyncConfiguration;
import org.apache.ldap.server.jndi.ServerContextFactory;
+import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
@@ -39,6 +40,8 @@
*/
public class ServerMain
{
+ private static Logger log = Logger.getLogger(ServerMain.class);
+
/**
* Takes a single argument, an optional properties file to load with server
* startup settings.
@@ -52,15 +55,16 @@
ServerStartupConfiguration cfg;
if ( args.length > 0 )
- {
- System.out.println( "server: loading settings from " + args[0] );
+ {
+ log.info("Loading settings from " + args[0]);
+
ApplicationContext factory = new FileSystemXmlApplicationContext( args[0] );
cfg = ( ServerStartupConfiguration ) factory.getBean( "configuration" );
env = ( Properties ) factory.getBean( "environment" );
}
else
{
- System.out.println( "server: using default settings ..." );
+ log.info( "Using default settings ..." );
env = new Properties();
cfg = new MutableServerStartupConfiguration();
}
@@ -71,7 +75,7 @@
new InitialDirContext( env );
- System.out.println( "server: started in "
+ log.info( "Started in "
+ ( System.currentTimeMillis() - startTime )
+ " milliseconds");
Index: project.xml
===================================================================
--- project.xml (revision 201825)
+++ project.xml (working copy)
@@ -70,12 +70,19 @@
+
+
+
+ junit
+ 3.8.1
+
Index: shared/project.xml
===================================================================
--- shared/project.xml (revision 201825)
+++ shared/project.xml (working copy)
@@ -18,6 +18,12 @@
ldap-common
0.9.1-SNAPSHOT
+
+
+ log4j
+ log4j
+ 1.2.8
+
Index: core/maven.xml
===================================================================
--- core/maven.xml (revision 201825)
+++ core/maven.xml (working copy)
@@ -17,5 +17,10 @@
-
+
+
+
+
+
+
Index: core/project.xml
===================================================================
--- core/project.xml (revision 201825)
+++ core/project.xml (working copy)
@@ -105,6 +105,11 @@
mina
0.7.3-SNAPSHOT
+
+ log4j
+ log4j
+ 1.2.8
+
Index: core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java
===================================================================
--- core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java (revision 201825)
+++ core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java (working copy)
@@ -22,7 +22,7 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
+import java.util.List;
import java.util.Set;
import javax.naming.directory.Attributes;
Index: core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java
===================================================================
--- core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java (revision 201825)
+++ core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/MainFrame.java (working copy)
@@ -74,6 +74,7 @@
import org.apache.ldap.server.partition.impl.btree.Index;
import org.apache.ldap.server.partition.impl.btree.IndexRecord;
import org.apache.ldap.server.partition.impl.btree.SearchEngine;
+import org.apache.log4j.Logger;
/**
@@ -85,6 +86,8 @@
public class MainFrame extends JFrame
{
private static final long serialVersionUID = 4049353102291513657L;
+ private static final Logger log = Logger.getLogger(MainFrame.class);
+ private static final boolean DEBUG = log.isDebugEnabled();
// Swing Stuff
private JLabel statusBar = new JLabel( "Ready" );
@@ -301,7 +304,7 @@
{
public void actionPerformed( ActionEvent an_event )
{
- System.out.println( "action command = "
+ log.debug( "action command = "
+ an_event.getActionCommand() );
try
{
@@ -527,9 +530,21 @@
}
else if ( mode == FilterDialog.DEBUG_MODE )
{
- doDebug( dialog.getFilter(), dialog.getScope(),
- dialog.getBase(), dialog.getLimit() );
- }
+ if (DEBUG)
+ {
+ log.debug( "Search attempt using filter '" + dialog.getFilter() + "' "
+ + "with scope '" + dialog.getScope() + "' and a return limit of '"
+ + dialog.getLimit() + "'" );
+
+ }
+ else //it would seem we need to make a debug statement, based on a program instruction
+ { //which differs to the log4j priority.
+ //in this circumstance we simply use the old System printwriter for stdout.
+ System.out.println( "Search attempt using filter '" + dialog.getFilter() + "' "
+ + "with scope '" + dialog.getScope() + "' and a return limit of '"
+ + dialog.getLimit() + "'" );
+ }
+ }
else if ( mode == FilterDialog.ANNOTATE_MODE )
{
if ( doAnnotate( dialog.getFilter() ) )
@@ -606,9 +621,13 @@
String limit )
throws Exception
{
- System.out.println( "Search attempt using filter '" + filter + "' "
+ if (DEBUG)
+ {
+ log.debug( "Search attempt using filter '" + filter + "' "
+ "with scope '" + scope + "' and a return limit of '" + limit
+ "'" );
+ }
+
FilterParser parser = new FilterParserImpl();
ExprNode root = null;
@@ -708,16 +727,6 @@
return true;
}
-
- public void doDebug( String filter, String scope, String base,
- String limit )
- {
- System.out.println( "Search attempt using filter '" + filter + "' "
- + "with scope '" + scope + "' and a return limit of '" + limit
- + "'" );
- }
-
-
public void selectTreeNode( BigInteger id )
{
Stack stack = new Stack();
Index: core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java
===================================================================
--- core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java (revision 201825)
+++ core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/IndexDialog.java (working copy)
@@ -42,6 +42,7 @@
import org.apache.ldap.server.partition.impl.btree.Index;
import org.apache.ldap.server.partition.impl.btree.IndexRecord;
import org.apache.regexp.RE;
+import org.apache.log4j.Logger;
/**
@@ -53,6 +54,7 @@
public class IndexDialog extends JDialog
{
private static final long serialVersionUID = 3689917253680445238L;
+ private static final Logger log = Logger.getLogger(IndexDialog.class);
public static final String DEFAULT_CURSOR = "Default" ;
public static final String EQUALITY_CURSOR = "Equality" ;
Index: core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AddEntryDialog.java
===================================================================
--- core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AddEntryDialog.java (revision 201825)
+++ core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/AddEntryDialog.java (working copy)
@@ -38,6 +38,7 @@
import javax.swing.JTextField;
import org.apache.ldap.common.message.LockableAttributesImpl;
+import org.apache.log4j.Logger;
/**
@@ -49,6 +50,8 @@
public class AddEntryDialog extends JDialog implements ActionListener
{
private static final long serialVersionUID = 3544671793504663604L;
+ private static final Logger log = Logger.getLogger(AddEntryDialog.class);
+ private static final boolean DEBUG = log.isDebugEnabled();
private JPanel m_namePnl = new JPanel();
private JPanel m_attrPnl = new JPanel();
@@ -283,8 +286,10 @@
//to return an Integer, not a String:
public Object getCellEditorValue()
{
- System.out.println( "Editor returning '" + l_textField.getText()
- + "'" );
+ if (DEBUG)
+ log.debug( "Editor returning '" + l_textField.getText()
+ + "'" );
+
return l_textField.getText();
}
};
@@ -324,7 +329,7 @@
AttributesTableModel l_model = ( AttributesTableModel )
m_attrTbl.getModel();
int l_row = m_attrTbl.getSelectedRow();
- System.out.println( l_cmd );
+ log.debug( l_cmd );
if ( l_row >= l_model.getRowCount() || l_row < 0 )
{
Index: core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/PartitionViewer.java
===================================================================
--- core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/PartitionViewer.java (revision 201825)
+++ core/src/main/java/org/apache/ldap/server/partition/impl/btree/gui/PartitionViewer.java (working copy)
@@ -24,6 +24,7 @@
import org.apache.ldap.server.partition.impl.btree.BTreeContextPartition;
import org.apache.ldap.server.partition.impl.btree.SearchEngine;
+import org.apache.log4j.Logger;
/**
@@ -34,6 +35,8 @@
*/
public class PartitionViewer
{
+ private static final Logger log = Logger.getLogger(PartitionViewer.class);
+
/** A handle on the atomic partition */
private BTreeContextPartition partition;
private SearchEngine eng;
@@ -93,6 +96,6 @@
( screenSize.height - frameSize.height ) / 2) ;
frame.setVisible( true );
- System.out.println( frameSize ) ;
+ log.debug(frameSize);
}
}