bugzilla | 3 May 2010 23:06
Picon
Favicon

DO NOT REPLY [Bug 41214] Deadlock with RollingFileAppender

https://issues.apache.org/bugzilla/show_bug.cgi?id=41214

--- Comment #30 from rob_gar_esp <at> hotmail.com 2010-05-03 17:06:07 EDT ---
(In reply to comment #29)
> Any updates on this?
> 
> I have the same problem:
>
> "Thread-6" daemon prio=10 tid=0x00007feb02a29800 nid=0x387f waiting for monitor
> entry [0x00000000418bb000]
>    java.lang.Thread.State: BLOCKED (on object monitor)
>         at org.apache.log4j.Category.callAppenders(Category.java:204)
>         - waiting to lock <0x00007feb091fab30> (a

I have a very similar problem:

"http-13180-143" daemon prio=10 tid=0x00002aac3c5bb000 nid=0x262c2 waiting for
monitor entry
[0x00002aac300bc000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.apache.log4j.Category.callAppenders(Category.java:201)
        - locked <0x00002aaab8919168> (a org.apache.log4j.spi.RootLogger)
        at org.apache.log4j.Category.forcedLog(Category.java:388)
        at org.apache.log4j.Category.error(Category.java:302)

Please assist.

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
(Continue reading)

bugzilla | 3 May 2010 23:06
Picon
Favicon

DO NOT REPLY [Bug 41214] Deadlock with RollingFileAppender

https://issues.apache.org/bugzilla/show_bug.cgi?id=41214

rob_gar_esp <at> hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rob_gar_esp <at> hotmail.com

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
Scott Deboy | 4 May 2010 07:04
Picon

companions release

Are there any outstanding issues preventing us from moving forward with a release of the companions?

Scott

bugzilla | 4 May 2010 10:55
Picon
Favicon

DO NOT REPLY [Bug 49243] New: Fix one BZ number in Changelog of 1.2.16

https://issues.apache.org/bugzilla/show_bug.cgi?id=49243

           Summary: Fix one BZ number in Changelog of 1.2.16
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: minor
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: rainer.jung <at> kippdata.de

Created an attachment (id=25394)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25394)
Patch for 1.2.16 changelog fixing one BZ number

One BZ number is wrong, 49812 -> 48912
See attached patch.

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
bugzilla | 4 May 2010 19:04
Picon
Favicon

DO NOT REPLY [Bug 49247] New: Add option for persistent/non-persistent delivery in JMSAppender

https://issues.apache.org/bugzilla/show_bug.cgi?id=49247

           Summary: Add option for persistent/non-persistent delivery in
                    JMSAppender
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: vandezuma <at> gmail.com

Add a boolean property to org.apache.log4j.net.JMSAppender that will specify if
messages should be sent in persistent delivery mode.  In high-volume
applications, persistent delivery (currently the default) can cause performance
problems on the JMS server.

Suggested code changes:

...
boolean persistentDelivery = false;  // add getters/setters
...

  /**
     This method called by { <at> link AppenderSkeleton#doAppend} method to
     do most of the real appending work.  */
  public void append(LoggingEvent event) {
    if(!checkEntryConditions()) {
      return;
    }

    try {
      ObjectMessage msg = topicSession.createObjectMessage();
      if(locationInfo) {
    event.getLocationInformation();
      }
      msg.setObject(event);

      /****** Enhancement - check for persistent delivery ******/
      msg.setJMSDeliveryMode(persistentDelivery ? 
           DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
      /****** End of enhancement ******/

      topicPublisher.publish(msg);
    } catch(JMSException e) {
      errorHandler.error("Could not publish message in JMSAppender
["+name+"].", e,
             ErrorCode.GENERIC_FAILURE);
    } catch(RuntimeException e) {
      errorHandler.error("Could not publish message in JMSAppender
["+name+"].", e,
             ErrorCode.GENERIC_FAILURE);
    }
  }

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
bugzilla | 4 May 2010 20:17
Picon
Favicon

DO NOT REPLY [Bug 49247] Add option for persistent/non-persistent delivery in JMSAppender

https://issues.apache.org/bugzilla/show_bug.cgi?id=49247

--- Comment #1 from Scott Vandezande <vandezuma <at> gmail.com> 2010-05-04 14:17:12 EDT ---
Just discovered, you have to also set the delivery mode on the topicSender:

in activateOptions():

     topicPublisher = topicSession.createPublisher(topic); //existing

     topicPublisher.setDeliveryMode(this.persistentDelivery ? 
              DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
bugzilla | 4 May 2010 21:41
Picon
Favicon

DO NOT REPLY [Bug 49248] New: javadoc for org.apache.log4j.rolling.FixedWindowRollingPolicy is misleading

https://issues.apache.org/bugzilla/show_bug.cgi?id=49248

           Summary: javadoc for
                    org.apache.log4j.rolling.FixedWindowRollingPolicy is
                    misleading
           Product: Log4j
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: doug_newman <at> raytheon.com

An extract from the javadoc for this class reads,

'Let "foo.log" be the value of the ActiveFile'

It should read,

'Let "foo.log" be the value of the ActiveFileName'

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
Curt Arnold | 5 May 2010 04:16
Picon
Favicon

Re: companions release

Need to back port some of the later fixes in the log4j 1.2.16 release back into the extras companion.  Other
than that I don't know of anything.

I've got some evenings free later this week and was going to try to clean up some post 1.2.16 issues.

On May 4, 2010, at 12:04 AM, Scott Deboy wrote:

> Are there any outstanding issues preventing us from moving forward with a release of the companions?
> 
> Scott
sdeboy | 5 May 2010 09:17
Picon
Favicon

svn commit: r941180 - in /logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia: LogFilePatternReceiver.java LogFilePatternReceiverBeanInfo.java

Author: sdeboy
Date: Wed May  5 07:17:00 2010
New Revision: 941180

URL: http://svn.apache.org/viewvc?rev=941180&view=rev
Log:
added support for 'custom level definitions' in LogFilePatternReceiver, which allows the user to map
strings in the log file to Log4j levels
if there are extra spaces that would prevent a pattern from matching, strip them out
exclude empty lines (if appendNonMatches was false, would add an empty line to the log)

With these changes, redirection of Android logging via 'logcat -v time' will now render fine in Chainsaw, using:
<param name="logFormat" value="TIMESTAMP LEVEL/LOGGER(PROP(PID)):MESSAGE"/> 
<param name="customLevelDefinitions" value="V=TRACE,D=DEBUG,I=INFO,W=WARN,E=ERROR,F=FATAL,S=OFF"/>

Modified:
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
    logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java?rev=941180&r1=941179&r2=941180&view=diff
==============================================================================
---
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java (original)
+++
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiver.java
Wed May  5 07:17:00 2010
 <at>  <at>  -31,6 +31,7  <at>  <at>  import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.StringTokenizer;

 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 <at>  <at>  -158,11 +159,10  <at>  <at>  public class LogFilePatternReceiver exte
   private static final String REGEXP_DEFAULT_WILDCARD = ".*?";
   private static final String REGEXP_GREEDY_WILDCARD = ".*";
   private static final String PATTERN_WILDCARD = "*";
-  private static final String NOSPACE_GROUP = "(\\S*?)";
+  private static final String NOSPACE_GROUP = "(\\S*\\s*?)";
   private static final String DEFAULT_GROUP = "(" + REGEXP_DEFAULT_WILDCARD + ")";
   private static final String GREEDY_GROUP = "(" + REGEXP_GREEDY_WILDCARD + ")";
   private static final String MULTIPLE_SPACES_REGEXP = "[ ]+";
-  
   private final String newLine = System.getProperty("line.separator");

   private final String[] emptyException = new String[] { "" };
 <at>  <at>  -170,6 +170,7  <at>  <at>  public class LogFilePatternReceiver exte
   private SimpleDateFormat dateFormat;
   private String timestampFormat = "yyyy-MM-d HH:mm:ss,SSS";
   private String logFormat;
+  private String customLevelDefinitions;
   private String fileURL;
   private String host;
   private String path;
 <at>  <at>  -197,6 +198,7  <at>  <at>  public class LogFilePatternReceiver exte
   private boolean useCurrentThread;
   public static final int MISSING_FILE_RETRY_MILLIS = 10000;
   private boolean appendNonMatches;
+  private final Map customLevelDefinitionMap = new HashMap();

     public LogFilePatternReceiver() {
     keywords.add(TIMESTAMP);
 <at>  <at>  -235,6 +237,20  <at>  <at>  public class LogFilePatternReceiver exte
     this.fileURL = fileURL;
   }

+    /**
+     * If the log file contains non-log4j level strings, they can be mapped to log4j levels using the format
(android example):
+     * V=TRACE,D=DEBUG,I=INFO,W=WARN,E=ERROR,F=FATAL,S=OFF
+     *
+     *  <at> param customLevelDefinitions the level definition string
+     */
+  public void setCustomLevelDefinitions(String customLevelDefinitions) {
+    this.customLevelDefinitions = customLevelDefinitions;
+  }
+
+  public String getCustomLevelDefinitions() {
+    return customLevelDefinitions;
+  }
+
   /**
    * Accessor
    *  <at> return append non matches
 <at>  <at>  -479,6 +495,8  <at>  <at>  public class LogFilePatternReceiver exte
         Perl5Matcher eventMatcher = new Perl5Matcher();
         String line;
         while ((line = bufferedReader.readLine()) != null) {
+            //skip empty line entries
+            if (line.trim().equals("")) {continue;}
             if (eventMatcher.matches(line, regexpPattern)) {
                 //build an event from the previous match (held in current map)
                 LoggingEvent event = buildEvent();
 <at>  <at>  -631,7 +649,8  <at>  <at>  public class LogFilePatternReceiver exte
       dateFormat = new SimpleDateFormat(timestampFormat);
       timestampPatternText = convertTimestamp();
     }
-
+    //if custom level definitions exist, parse them
+    updateCustomLevelDefinitionMap();
     try {
       if (filterExpression != null) {
         expressionRule = ExpressionRule.getRule(filterExpression);
 <at>  <at>  -729,6 +748,18  <at>  <at>  public class LogFilePatternReceiver exte
     getLogger().debug("regexp is " + regexp);
   }

+    private void updateCustomLevelDefinitionMap() {
+        if (customLevelDefinitions != null) {
+            StringTokenizer entryTokenizer = new StringTokenizer(customLevelDefinitions, ",");
+
+            customLevelDefinitionMap.clear();
+            while (entryTokenizer.hasMoreTokens()) {
+                StringTokenizer innerTokenizer = new StringTokenizer(entryTokenizer.nextToken(), "=");
+                customLevelDefinitionMap.put(innerTokenizer.nextToken(), Level.toLevel(innerTokenizer.nextToken()));
+            }
+        }
+    }
+
     private boolean isInteger(String value) {
         try {
             Integer.parseInt(value);
 <at>  <at>  -847,11 +878,24  <at>  <at>  public class LogFilePatternReceiver exte
     }

     level = (String) fieldMap.remove(LEVEL);
-    Level levelImpl = (level == null ? Level.DEBUG : Level.toLevel(level.trim()));
-    if (level != null && !level.equals(levelImpl.toString())) {
-        getLogger().debug("found unexpected level: " + level + ", logger: " + logger.getName() + ", msg: " + message);
-        //make sure the text that couldn't match a level is added to the message
-        message = level + " " + message;
+    Level levelImpl;
+    if (level == null) {
+        levelImpl = Level.DEBUG;
+    } else {
+        //first try to resolve against custom level definition map, then fall back to regular levels
+        levelImpl = (Level) customLevelDefinitionMap.get(level);
+        if (levelImpl == null) {
+            levelImpl = Level.toLevel(level.trim());
+            if (!level.equals(levelImpl.toString())) {
+                //check custom level map
+                if (levelImpl == null) {
+                    levelImpl = Level.DEBUG;
+                    getLogger().debug("found unexpected level: " + level + ", logger: " + logger.getName() + ", msg: " + message);
+                    //make sure the text that couldn't match a level is added to the message
+                    message = level + " " + message;
+                }
+            }
+        }
     }

     threadName = (String) fieldMap.remove(THREAD);

Modified: logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java
URL: http://svn.apache.org/viewvc/logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java?rev=941180&r1=941179&r2=941180&view=diff
==============================================================================
---
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java (original)
+++
logging/log4j/companions/receivers/trunk/src/main/java/org/apache/log4j/varia/LogFilePatternReceiverBeanInfo.java
Wed May  5 07:17:00 2010
 <at>  <at>  -42,6 +42,7  <at>  <at>  public class LogFilePatternReceiverBeanI
           "filterExpression", LogFilePatternReceiver.class),
         new PropertyDescriptor("waitMillis", LogFilePatternReceiver.class),
         new PropertyDescriptor("appendNonMatches", LogFilePatternReceiver.class),
+        new PropertyDescriptor("customLevelDefinitions", LogFilePatternReceiver.class),
         new PropertyDescriptor("useCurrentThread", LogFilePatternReceiver.class),
       };
     } catch (Exception e) {
bugzilla | 7 May 2010 13:17
Picon
Favicon

DO NOT REPLY [Bug 46592] trim() on property file entries

https://issues.apache.org/bugzilla/show_bug.cgi?id=46592

--- Comment #4 from Matthew Buckett <buckett <at> bumph.org> 2010-05-07 07:17:15 EDT ---
I've just encountered this bug with log4j 1.2.15.

--

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Gmane