bugzilla | 1 Aug 19:44 2011
Picon

DO NOT REPLY [Bug 50817] The JDBCAppender can't insert log info like this:hello'world

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

Anurag Agarwal <anurag08agarwal <at> gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anurag08agarwal <at> gmail.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.
bugzilla | 1 Aug 20:02 2011
Picon

DO NOT REPLY [Bug 51597] New: JDBCAppender not closed due to SQL Exception while executing an SQL

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

             Bug #: 51597
           Summary: JDBCAppender not closed due to SQL Exception while
                    executing an SQL
           Product: Log4j
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: anurag08agarwal <at> gmail.com
    Classification: Unclassified

Created attachment 27339
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27339
Log4j-JDBC-Appender-Issue.doc

In JDBCAppender.java there is method execute(String sql). This method is used
to insert the SQL into DB, but in case if anything wrong happen while
inserting, then it throws one SQLException and closing only SQL statement but
connection is not closed, and so Appender thread is still alive.

Now as the execute method is called via flushBuffer() method, this method is
calling execute and then event is added to removes list, but if execute method
had thrown the SQLException then the event is not added to removes list and
removes list is growing continuously. And that is in the buffer tile next call
(Continue reading)

bugzilla | 1 Aug 20:03 2011
Picon

DO NOT REPLY [Bug 51597] JDBCAppender not closed due to SQL Exception while executing an SQL

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

Anurag Agarwal <anurag08agarwal <at> gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anurag08agarwal <at> gmail.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.
Christian Grobmeier | 3 Aug 17:55 2011
Picon

Some minor pain with companions

Hi,

just co'ed companions.

I was wondering why companions is not a maven multimodule project.
Receivers depends on extras and component. It was a bit pain to create
the eclipse project. Any reasons not to go multimodule?

Then extras has a failing test case:
Failed tests:   testBasic(org.apache.log4j.xml.XSLTLayoutTestCase)
Tests run: 510, Failures: 1, Errors: 0, Skipped: 0

Did not look into it so far

And finally :-) receivers is dependend to

 <artifactId>apache-log4j-extras</artifactId>
 <version>1.1-SNAPSHOT</version>

but this seems wrong to me. I could only build it when I installed
1.2-SNAPSHOT locally. Another reason for going multimodule, but for
now, is it ok to upgrade this version to 1.2-SNAPSHOT?

Cheers
Christian
Scott Deboy | 3 Aug 18:33 2011
Picon

Re: Some minor pain with companions

Hi Christian,

I'd think changing things to multi-module makes sense.  Feel free to change the dependency...could it depend on extras 1.1, not the snapshot?

Not sure why the test is failing.  I can check it out.

Scott

On Wed, Aug 3, 2011 at 8:55 AM, Christian Grobmeier <grobmeier <at> gmail.com> wrote:
Hi,

just co'ed companions.

I was wondering why companions is not a maven multimodule project.
Receivers depends on extras and component. It was a bit pain to create
the eclipse project. Any reasons not to go multimodule?

Then extras has a failing test case:
Failed tests:   testBasic(org.apache.log4j.xml.XSLTLayoutTestCase)
Tests run: 510, Failures: 1, Errors: 0, Skipped: 0

Did not look into it so far

And finally :-) receivers is dependend to

 <artifactId>apache-log4j-extras</artifactId>
 <version>1.1-SNAPSHOT</version>

but this seems wrong to me. I could only build it when I installed
1.2-SNAPSHOT locally. Another reason for going multimodule, but for
now, is it ok to upgrade this version to 1.2-SNAPSHOT?

Cheers
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe <at> logging.apache.org
For additional commands, e-mail: log4j-dev-help <at> logging.apache.org


Christian Grobmeier | 3 Aug 18:37 2011
Picon

Re: Some minor pain with companions

> I'd think changing things to multi-module makes sense.

I will try to make it multimodule

> Feel free to change
> the dependency...could it depend on extras 1.1, not the snapshot?

yes, i changed the dependency to 1.1 as you said, it builds fine at my desk

> Not sure why the test is failing.  I can check it out.

I hoped that :-)

>
> Scott
>
> On Wed, Aug 3, 2011 at 8:55 AM, Christian Grobmeier <grobmeier <at> gmail.com>
> wrote:
>>
>> Hi,
>>
>> just co'ed companions.
>>
>> I was wondering why companions is not a maven multimodule project.
>> Receivers depends on extras and component. It was a bit pain to create
>> the eclipse project. Any reasons not to go multimodule?
>>
>> Then extras has a failing test case:
>> Failed tests:   testBasic(org.apache.log4j.xml.XSLTLayoutTestCase)
>> Tests run: 510, Failures: 1, Errors: 0, Skipped: 0
>>
>> Did not look into it so far
>>
>> And finally :-) receivers is dependend to
>>
>>  <artifactId>apache-log4j-extras</artifactId>
>>  <version>1.1-SNAPSHOT</version>
>>
>> but this seems wrong to me. I could only build it when I installed
>> 1.2-SNAPSHOT locally. Another reason for going multimodule, but for
>> now, is it ok to upgrade this version to 1.2-SNAPSHOT?
>>
>> Cheers
>> Christian
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-dev-unsubscribe <at> logging.apache.org
>> For additional commands, e-mail: log4j-dev-help <at> logging.apache.org
>>
>
>

--

-- 
http://www.grobmeier.de
rgoers | 3 Aug 19:07 2011
Picon

svn commit: r1153584 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core: appender/rolling/DefaultRolloverStrategy.java config/FileConfigurationMonitor.java config/XMLConfiguration.java

Author: rgoers
Date: Wed Aug  3 17:07:38 2011
New Revision: 1153584

URL: http://svn.apache.org/viewvc?rev=1153584&view=rev
Log:
Add FileMonitor. Remove max window size from RolloverStrategy

Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/FileConfigurationMonitor.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java?rev=1153584&r1=1153583&r2=1153584&view=diff
==============================================================================
---
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java (original)
+++
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java
Wed Aug  3 17:07:38 2011
 <at>  <at>  -61,10 +61,6  <at>  <at>  import java.util.List;
  */
  <at> Plugin(name = "DefaultRolloverStrategy", type = "Core", printObject = true)
 public class DefaultRolloverStrategy implements RolloverStrategy {
-    /**
-     * It's almost always a bad idea to have a large window size, say over 12.
-     */
-    private static final int MAX_WINDOW_SIZE = 12;
     private static final int MIN_WINDOW_SIZE = 1;
     private static final int DEFAULT_WINDOW_SIZE = 7;

 <at>  <at>  -222,17 +218,8  <at>  <at>  public class DefaultRolloverStrategy imp

      <at> PluginFactory
     public static DefaultRolloverStrategy createStrategy( <at> PluginAttr("max") String max,
-                                                              <at> PluginAttr("min") String min) {
-        int maxIndex;
-        if (max != null) {
-            maxIndex = Integer.parseInt(max);
-            if (maxIndex > MAX_WINDOW_SIZE) {
-                logger.error("Maximum window size too large. Limited to " + MAX_WINDOW_SIZE);
-                maxIndex = MAX_WINDOW_SIZE;
-            }
-        } else {
-            maxIndex = DEFAULT_WINDOW_SIZE;
-        }
+                                                          <at> PluginAttr("min") String min) {
+
         int minIndex;
         if (min != null) {
             minIndex = Integer.parseInt(min);
 <at>  <at>  -243,7 +230,16  <at>  <at>  public class DefaultRolloverStrategy imp
         } else {
             minIndex = MIN_WINDOW_SIZE;
         }
-
+        int maxIndex;
+        if (max != null) {
+            maxIndex = Integer.parseInt(max);
+            if (maxIndex < minIndex) {
+                maxIndex = minIndex < DEFAULT_WINDOW_SIZE ? DEFAULT_WINDOW_SIZE : minIndex;
+                logger.error("Maximum window size must be greater than the minimum windows size. Set to " + maxIndex);
+            }
+        } else {
+            maxIndex = DEFAULT_WINDOW_SIZE;
+        }
         return new DefaultRolloverStrategy(minIndex, maxIndex);
     }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/FileConfigurationMonitor.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/FileConfigurationMonitor.java?rev=1153584&r1=1153583&r2=1153584&view=diff
==============================================================================
---
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/FileConfigurationMonitor.java (original)
+++
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/FileConfigurationMonitor.java
Wed Aug  3 17:07:38 2011
 <at>  <at>  -24,16 +24,45  <at>  <at>  import java.util.List;
  */
 public class FileConfigurationMonitor implements ConfigurationMonitor {

-    private File file;
+    private final File file;

-    private List<ConfigurationListener> listeners;
+    private long lastModified;

-    public FileConfigurationMonitor(File file, List<ConfigurationListener> listeners) {
+    private final List<ConfigurationListener> listeners;
+
+    private final int interval;
+
+    private long nextCheck;
+
+    private final static int MIN_INTERVAL = 30;
+
+    private volatile int counter = 0;
+    private static final int MASK = 0x0f;
+    private long start;
+
+    public FileConfigurationMonitor(File file, List<ConfigurationListener> listeners, int interval) {
         this.file = file;
+        this.lastModified = file.lastModified();
         this.listeners = listeners;
+        this.interval = (interval < MIN_INTERVAL ? MIN_INTERVAL : interval) * 1000;
+        this.nextCheck = System.currentTimeMillis() + interval;
+        this.start = System.nanoTime();
     }

     public void checkConfiguration() {
-
+        if ((++counter & MASK) == 0) {
+            long current = System.currentTimeMillis();
+            synchronized(this) {
+                if (current >= nextCheck) {
+                    nextCheck = current + interval;
+                    if (lastModified >= file.lastModified()) {
+                        lastModified = file.lastModified();
+                        for (ConfigurationListener listener : listeners) {
+                            listener.onChange();
+                        }
+                    }
+                }
+            }
+        }
     }
 }

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java?rev=1153584&r1=1153583&r2=1153584&view=diff
==============================================================================
---
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java (original)
+++
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/config/XMLConfiguration.java
Wed Aug  3 17:07:38 2011
 <at>  <at>  -98,7 +98,7  <at>  <at>  public class XMLConfiguration extends Ba
                 } else if ("monitorInterval".equalsIgnoreCase(entry.getKey())) {
                     int interval = Integer.parseInt(entry.getValue());
                     if (interval > 0 && configFile != null) {
-                        monitor = new FileConfigurationMonitor(configFile, listeners);
+                        monitor = new FileConfigurationMonitor(configFile, listeners, interval);
                     }
                 }
             }
bugzilla | 3 Aug 23:33 2011
Picon

DO NOT REPLY [Bug 50776] Support TCP in SyslogAppender

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

Daniel Serodio <asfbugzilla.e.dserodio <at> neverbox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asfbugzilla.e.dserodio <at> neve
                   |                            |rbox.com

--- Comment #2 from Daniel Serodio <asfbugzilla.e.dserodio <at> neverbox.com> 2011-08-03 21:33:03 UTC ---
I also thought it was already implemented

--

-- 
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 Aug 11:03 2011
Picon

DO NOT REPLY [Bug 51612] New: LoggingEvent can contain wrong thread name in multithreaded environment

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

             Bug #: 51612
           Summary: LoggingEvent can contain wrong thread name in
                    multithreaded environment
           Product: Log4j
           Version: 1.2
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: r_gorbonosov <at> mail.ru
    Classification: Unclassified

Created attachment 27347
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27347
Simple code demonstrating the bug

Log4j version: 1.2.16

I have an appender attached to a logger. This appender performs the
LoggingEvent processing in a thread other than the thread where the
LoggingEvents were generated. Due to that fact that LoggingEvent.threadName is
lazily initialized (under certain conditions: there are different constructors
and I don't know which one is used when) I'm getting a wrong thread name in the
LoggingEvent.

Probably the LoggingEvent.threadName should not be lazily initialized.

In attachment there is a simple code demonstrating the bug.

In addition please pay attention that LoggingEvent class is not thread-safe:
access to LoggingEvent.threadName is not synchronized. So if in the example
above I have several appenders processing LoggingEvents in different threads
the actual thread name visible to appenders is unpredictable.

--

-- 
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 Aug 11:04 2011
Picon

DO NOT REPLY [Bug 51612] LoggingEvent can contain wrong thread name in multithreaded environment

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

RJoker <r_gorbonosov <at> mail.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r_gorbonosov <at> mail.ru
         OS/Version|                            |All

--

-- 
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