You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pe...@apache.org on 2007/01/26 10:12:54 UTC

svn commit: r500193 - /tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java

Author: pero
Date: Fri Jan 26 01:12:54 2007
New Revision: 500193

URL: http://svn.apache.org/viewvc?view=rev&rev=500193
Log:
Log to manager logger like StandardSession implementation.

Modified:
    tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java

Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java?view=diff&rev=500193&r1=500192&r2=500193
==============================================================================
--- tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java (original)
+++ tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java Fri Jan 26 01:12:54 2007
@@ -409,9 +409,8 @@
                         } catch (Exception e) {
                             ;
                         }
-                        // FIXME - should we do anything besides log these?
-                        log.error(sm.getString("standardSession.sessionEvent"),
-                                t);
+                        manager.getContainer().getLogger().error
+                           (sm.getString("standardSession.sessionEvent"), t);
                     }
                 }
             }
@@ -727,15 +726,14 @@
                             } catch (Exception e) {
                                 ;
                             }
-                            // FIXME - should we do anything besides log these?
-                            log.error(sm
+                            manager.getContainer().getLogger().error(sm
                                     .getString("standardSession.sessionEvent"),
                                     t);
                         }
                     }
                 }
-            }//end if
-            //end fix
+            }
+
             accessCount = 0;
             setValid(false);
 
@@ -1255,7 +1253,8 @@
                 try {
                     ((HttpSessionBindingListener) value).valueBound(event);
                 } catch (Exception x) {
-                    log.error(smp.getString("deltaSession.valueBound.ex"), x);
+                    manager.getContainer().getLogger().error
+                        (smp.getString("deltaSession.valueBound.ex"), x);
                 }
             }
         }
@@ -1270,7 +1269,8 @@
                         .valueUnbound(new HttpSessionBindingEvent(
                                 (HttpSession) getSession(), name));
             } catch (Exception x) {
-                log.error(smp.getString("deltaSession.valueBinding.ex"), x);
+                manager.getContainer().getLogger().error
+                    (smp.getString("deltaSession.valueBinding.ex"), x);
             }
 
         }
@@ -1281,7 +1281,6 @@
 
         // Notify interested application event listeners
         Context context = (Context) manager.getContainer();
-        //fix for standalone manager without container
         if (context != null) {
             Object listeners[] = context.getApplicationEventListeners();
             if (listeners == null)
@@ -1324,16 +1323,11 @@
                     } catch (Exception e) {
                         ;
                     }
-                    // FIXME - should we do anything besides log these?
-                    log
-                            .error(
-                                    sm
-                                            .getString("standardSession.attributeEvent"),
-                                    t);
+                    manager.getContainer().getLogger().error
+                        (sm.getString("standardSession.attributeEvent"),t);
                 }
-            } //for
-        }//end if
-        //end fix
+            }
+        }
 
     }
 
@@ -1374,8 +1368,9 @@
 
         //        setId((String) stream.readObject());
         id = (String) stream.readObject();
-        if (log.isDebugEnabled())
-            log.debug(smp.getString("deltaSession.readSession",  id));
+        org.apache.commons.logging.Log managerLog = manager.getContainer().getLogger() ;
+        if (managerLog.isDebugEnabled())
+            managerLog.debug(smp.getString("deltaSession.readSession",  id));
 
         // Deserialize the attribute count and attribute values
         if (attributes == null)
@@ -1388,6 +1383,9 @@
             Object value = (Object) stream.readObject();
             if ((value instanceof String) && (value.equals(NOT_SERIALIZED)))
                 continue;
+            if (managerLog.isDebugEnabled())
+                managerLog.debug("  loading attribute '" + name +
+                    "' with value '" + value + "'");
             attributes.put(name, value);
         }
         isValid = isValidSave;
@@ -1438,8 +1436,9 @@
         }
 
         stream.writeObject(id);
-        if (log.isDebugEnabled())
-            log.debug(smp.getString("deltaSession.writeSession",id));
+        org.apache.commons.logging.Log managerLog = manager.getContainer().getLogger() ;
+        if (managerLog.isDebugEnabled())
+            managerLog.debug(smp.getString("deltaSession.writeSession",id));
 
         // Accumulate the names of serializable and non-serializable attributes
         String keys[] = keys();
@@ -1463,15 +1462,18 @@
             stream.writeObject((String) saveNames.get(i));
             try {
                 stream.writeObject(saveValues.get(i));
-                //                if (log.isDebugEnabled())
-                //                    log.debug(" storing attribute '" + saveNames.get(i) +
-                //                        "' with value '" + saveValues.get(i) + "'");
+                if (managerLog.isDebugEnabled()) {
+                    managerLog.debug(" storing attribute '" + saveNames.get(i) +
+                        "' with value '" + saveValues.get(i) + "'");
+                }
             } catch (NotSerializableException e) {
-                log.error(sm.getString("standardSession.notSerializable",
+                managerLog.warn(sm.getString("standardSession.notSerializable",
                         saveNames.get(i), id), e);
                 stream.writeObject(NOT_SERIALIZED);
-                log.error("  storing attribute '" + saveNames.get(i)
+                if(managerLog.isDebugEnabled()) {
+                    managerLog.debug("  storing attribute '" + saveNames.get(i)
                         + "' with value NOT_SERIALIZED");
+                }
             }
         }
 
@@ -1589,12 +1591,12 @@
             try {
                 ((HttpSessionBindingListener) value).valueUnbound(event);
             } catch (Exception x) {
-                log.error(smp.getString("deltaSession.valueUnbound.ex"), x);
+                manager.getContainer().getLogger().error
+                    (smp.getString("deltaSession.valueUnbound.ex"), x);
             }
         }
         // Notify interested application event listeners
         Context context = (Context) manager.getContainer();
-        //fix for standalone manager without container
         if (context != null) {
             Object listeners[] = context.getApplicationEventListeners();
             if (listeners == null)
@@ -1620,16 +1622,11 @@
                     } catch (Exception e) {
                         ;
                     }
-                    // FIXME - should we do anything besides log these?
-                    log
-                            .error(
-                                    sm
-                                            .getString("standardSession.attributeEvent"),
-                                    t);
+                    manager.getContainer().getLogger().error
+                        (sm.getString("standardSession.attributeEvent"),t);
                 }
-            } //for
-        }//end if
-        //end fix
+            }
+        }
 
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org