bugzilla | 4 Feb 2010 14:48
Picon
Favicon

DO NOT REPLY [Bug 48679] New: performance of getEffectiveLevel can be significantly improved

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

           Summary: performance of getEffectiveLevel can be significantly
                    improved
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: omry <at> yadan.net

Whenever the client logs something getEffectiveLevel is called.
getEffectiveLevel in turn, goes up the loggers hierarchy until it finds a
logger that have an explicit log level.

it's possible to improve the logging performance by setting the effective level
as a member, and maintain it whenever the hierarchy changes or a parent logger
level is set.

--

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

svn commit: r906816 - in /logging/log4j/trunk: pom.xml src/changes/changes.xml

Author: carnold
Date: Fri Feb  5 05:04:27 2010
New Revision: 906816

URL: http://svn.apache.org/viewvc?rev=906816&view=rev
Log:
Bug 43313: Update Maven plugins prior to 1.2.16

Modified:
    logging/log4j/trunk/pom.xml
    logging/log4j/trunk/src/changes/changes.xml

Modified: logging/log4j/trunk/pom.xml
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/pom.xml?rev=906816&r1=906815&r2=906816&view=diff
==============================================================================
--- logging/log4j/trunk/pom.xml (original)
+++ logging/log4j/trunk/pom.xml Fri Feb  5 05:04:27 2010
 <at>  <at>  -95,7 +95,7  <at>  <at> 
       </plugin>
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.4.3</version>
+        <version>2.5</version>
         <configuration>
           <workingDirectory>tests</workingDirectory>
           <reportFormat>plain</reportFormat>
 <at>  <at>  -149,7 +149,7  <at>  <at> 
       </plugin>
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
(Continue reading)

Gonzalo Herreros-Gonzalez | 5 Feb 2010 11:39
Favicon

New rolling appender proposal

Hi,

 

I came across an issue with the RollingFileAppender and I would like to contribute back my solution.

 

The problem is that we have a RollingFileAppender to log customer usage. So you have, let’s say a file with the user activity for each minute.

This logs are exported into other systems that do monitoring and business intelligence based on that feedback.

 

The problem is that the rolling is tied to log events, so if events stop happening (the customers end their working hours) the log is not rolled until the next morning when the system is used again. So the external systems don’t receive that log until the next day since the export script cannot do the rolling by itself.

 

Therefore I developed and extension of the appender, that schedules itself to rollover the file at the expected time if it hasn’t been rolled by events.

I have tested it and I haven’t seen any impact in performance. Only one thread is used, which is enough for a reasonable number of appenders of this type.

 

See below the source code of the new appender.

Let me know what you think.

 

Regards, Gonzalo

 

 

/*

 * Copyright 1999-2005 The Apache Software Foundation.

 *

 * Licensed under the Apache License, Version 2.0 (the "License");

 * you may not use this file except in compliance with the License.

 * You may obtain a copy of the License at

 *

 *      http://www.apache.org/licenses/LICENSE-2.0

 *

 * Unless required by applicable law or agreed to in writing, software

 * distributed under the License is distributed on an "AS IS" BASIS,

 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

 * See the License for the specific language governing permissions and

 * limitations under the License.

 */

 

 

 

package org.apache.log4j;

 

import java.util.concurrent.ScheduledThreadPoolExecutor;

import java.util.concurrent.TimeUnit;

 

import org.apache.log4j.helpers.LogLog;

 

/**

 * Extends the default time based rolling file appender to roll the files in a synchronous manner.

 * That means when the time is due the file will be rolled, instead of rolling the file when

 *  a new event is logged and the timeout is detected.

 *

 * <at> author Gonzalo Herreros

 */

public class SynchronousDailyRollingFileAppender extends DailyRollingFileAppender

{

    //One thread should be enough for a reasonable amount of rolling appenders

    //Anyway there should be no harm if there is a small delay

    private static ScheduledThreadPoolExecutor scheduler = new ScheduledThreadPoolExecutor(1);

   

    /* (non-Javadoc)

     * <at> see org.apache.log4j.DailyRollingFileAppender#activateOptions()

     */

    public void activateOptions() {

        super.activateOptions();

        scheduleNextRollover();

    }

   

    /**

     * Schedule the next call so we try to rollover

     */

    protected void scheduleNextRollover() {

        long nextTime = rc.getNextCheckMillis(now);

        long lapse = nextTime - now.getTime();

        if (lapse > 0){

            synchronized(scheduler) {

                scheduler.schedule(new Runnable() {

                    public void run() {

                        try {

                            //Prevent conflicts with other threads writing the log

                            synchronized(this){                          

                                now.setTime(System.currentTimeMillis());

                                rollOver();

                            }

                        } catch(Throwable t) {

                            LogLog.error("rollOver() failed.", t);

                        }

                        scheduleNextRollover();

                    }

                }, lapse + 1, TimeUnit.MILLISECONDS);

            }

        }

    }

}

This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp
carnold | 7 Feb 2010 10:21
Picon
Favicon

[GUMP <at> vmgump]: Project logging-log4j-12-tests (in module logging-log4j-12) failed

To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at general <at> gump.apache.org.

Project logging-log4j-12-tests has an issue affecting its community integration.
This issue affects 1 projects,
 and has been outstanding for 26 runs.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
    - logging-log4j-12-tests :  Fast and flexible logging package for Java

Full details are available at:
    http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12-tests/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were provided:
 -INFO- Made directory [/srv/gump/public/workspace/logging-log4j-12/tests/classes]
 -INFO- Failed with reason build failed

The following work was performed:
http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12-tests/gump_work/build_logging-log4j-12_logging-log4j-12-tests.html
Work Name: build_logging-log4j-12_logging-log4j-12-tests (Type: Build)
Work ended in a state of : Failed
Elapsed: 38 secs
Command Line: /usr/lib/jvm/java-6-sun/bin/java -Djava.awt.headless=true
-Xbootclasspath/p:/srv/gump/public/workspace/xml-xerces2/build/xercesImpl.jar
org.apache.tools.ant.Main -Dgump.merge=/srv/gump/public/gump/work/merge.xml
-Dbuild.sysclasspath=only regression 
[Working Directory: /srv/gump/public/workspace/logging-log4j-12/tests]
CLASSPATH: /usr/lib/jvm/java-6-sun/lib/tools.jar:/srv/gump/public/workspace/logging-log4j-12/dist/classes:/srv/gump/public/workspace/logging-log4j-12/tests/classes:/srv/gump/public/workspace/logging-log4j-12/tests/resources:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/ant/dist/lib/ant-trax.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-nodeps.jar:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/packages/junit3.8.1/junit.jar:/srv/gump/public/workspace/logging-lo
 g4j-12/dist/lib/log4j-07022010.jar:/srv/gump/public/workspace/jakarta-oro/jakarta-oro-07022010.jar:/srv/gump/packages/javamail-1.4/mail.jar:/srv/gump/packages/javamail-1.4/lib/mailapi.jar:/s
 rv/gump/packages/jaf-1.1ea/activation.jar
---------------------------------------------
    [junit] ------------- ---------------- ---------------
    [junit] 
    [junit] Testcase: combinedTest took 0.159 sec
   [delete] Deleting: /srv/gump/public/workspace/logging-log4j-12/tests/classes/log4j.xml
   [delete] Deleting: /srv/gump/public/workspace/logging-log4j-12/tests/classes/log4j.properties

SocketServer:
    [junit] Running org.apache.log4j.net.SocketServerTestCase
    [junit] Testsuite: org.apache.log4j.net.SocketServerTestCase
    [junit] Tests run: 8, Failures: 0, Errors: 1, Time elapsed: 17.303 sec
    [junit] Tests run: 8, Failures: 0, Errors: 1, Time elapsed: 17.303 sec
    [junit] ------------- Standard Output ---------------
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] Setting up test case.
    [junit] Tearing down test case.
    [junit] ------------- ---------------- ---------------
    [junit] 
    [junit] Testcase: test1 took 1.209 sec
    [junit] Testcase: test2 took 1.025 sec
    [junit] Testcase: test3 took 1.033 sec
    [junit] 	Caused an ERROR
    [junit] [TRACE T2 [main] ? (?:?) Message 1]
    [junit] org.apache.log4j.util.UnexpectedFormatException: [TRACE T2 [main] ? (?:?) Message 1]
    [junit] 	at org.apache.log4j.util.ControlFilter.filter(ControlFilter.java:43)
    [junit] 	at org.apache.log4j.util.Transformer.transform(Transformer.java:42)
    [junit] 	at org.apache.log4j.net.SocketServerTestCase.test3(SocketServerTestCase.java:169)
    [junit] 
    [junit] Testcase: test4 took 1.118 sec
    [junit] Testcase: test5 took 2.071 sec
    [junit] Testcase: test6 took 2.029 sec
    [junit] Testcase: test7 took 2.021 sec
    [junit] Testcase: test8 took 2.036 sec

BUILD FAILED
/srv/gump/public/workspace/logging-log4j-12/tests/build.xml:325: Test
org.apache.log4j.net.SocketServerTestCase failed

Total time: 37 seconds
---------------------------------------------

To subscribe to this information via syndicated feeds:
- RSS: http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12-tests/rss.xml
- Atom: http://vmgump.apache.org/gump/public/logging-log4j-12/logging-log4j-12-tests/atom.xml

============================== Gump Tracking Only ===
Produced by Gump version 2.3.
Gump Run 06000007022010, vmgump:vmgump-public:06000007022010
Gump E-mail Identifier (unique within run) #12.

--
Apache Gump
http://gump.apache.org/ [Instance: vmgump]
bugzilla | 8 Feb 2010 00:08
Picon
Favicon

Bug report for Log4j [2010/02/07]

+---------------------------------------------------------------------------+
| Bugzilla Bug ID                                                           |
|     +---------------------------------------------------------------------+
|     | Status: UNC=Unconfirmed NEW=New         ASS=Assigned                |
|     |         OPN=Reopened    VER=Verified    (Skipped Closed/Resolved)   |
|     |   +-----------------------------------------------------------------+
|     |   | Severity: BLK=Blocker CRI=Critical  REG=Regression  MAJ=Major   |
|     |   |           MIN=Minor   NOR=Normal    ENH=Enhancement TRV=Trivial |
|     |   |   +-------------------------------------------------------------+
|     |   |   | Date Posted                                                 |
|     |   |   |          +--------------------------------------------------+
|     |   |   |          | Description                                      |
|     |   |   |          |                                                  |
|13099|Opn|Nor|2002-09-27|DOMConfigurator ignores category factory setting  |
|17887|Opn|Maj|2003-03-11|RollingFileAppender does not work for 10 threads  |
|20395|Inf|Enh|2003-06-01|PreparedStatementAppender Enhancement             |
|23329|New|Enh|2003-09-22|<logger> element in XML config should support reso|
|26084|Inf|Nor|2004-01-13|Log Event detail panel does not show special chara|
|27363|Inf|Enh|2004-03-02|JNI based SyslogAppender                          |
|27367|Inf|Enh|2004-03-02|NetSendAppender                                   |
|29244|Inf|Nor|2004-05-27|Preserve XML content in log messages when using XM|
|29305|New|Nor|2004-05-30|Chainsaw doesn't see locationinfo from XMLSocketRe|
|30055|New|Nor|2004-07-12|Problem with registering Appenders with the same n|
|30407|Inf|Maj|2004-07-30|Externally rolled file problem                    |
|30888|New|Maj|2004-08-27|Chainsaw mixes files in same panel                |
|30892|New|Min|2004-08-27|Log files cannot be closed                        |
|31089|New|Nor|2004-09-07|Does not accept ISO8601 dates in focus field      |
|31178|Inf|Cri|2004-09-11|Exception using Chainsaw for simple debugging     |
|31179|Ass|Enh|2004-09-11|Implement Chainsaw as Eclipse stand-alone applicat|
|33278|New|Min|2005-01-27|NPE thrown durring daily log file rollover        |
|33493|Inf|Enh|2005-02-10|contribution to log4j: servlet diagnostic context |
|34440|New|Nor|2005-04-13|sandbox:IMAppender - comma-seperated recipient lis|
|34491|Ver|Nor|2005-04-18|Missing include in build.jms target results in mis|
|34651|New|Enh|2005-04-27|allow for a header on top of every rolled file    |
|34738|Inf|Nor|2005-05-04|Chainsaw does not remember what Columns are select|
|34945|Inf|Nor|2005-05-17|ThrowableInformation has dubious Stack Trace extra|
|34974|Inf|Cri|2005-05-19|Exception when running a Pluglet                  |
|35239|Inf|Nor|2005-06-06|NullPointerException when saving displayed events |
|35563|Inf|Enh|2005-06-30|Syslog appender parametrability                   |
|35996|Inf|Enh|2005-08-03|Add support for ant-like <property> in log4j.xml  |
|36435|New|Enh|2005-08-31|Log4J RollingFileAppender under OpenVMS does not f|
|36654|Inf|Min|2005-09-14|Provide better error messages for "Please initiali|
|36789|Inf|Nor|2005-09-23|Empty control flow statement in org.apache.log4j.l|
|37349|Ass|Nor|2005-11-03|DBAppender not working with jTDS driver           |
|37638|New|Nor|2005-11-25|logging doesn't fall back with FallbackErrorHandle|
|37734|Inf|Nor|2005-12-01|Customize Event ID and Event Category with NTEVent|
|38363|Ass|Nor|2006-01-24|SecurityException during log output               |
|38394|Ver|Enh|2006-01-26|PropertySetter fails to print stacktrace if error |
|38395|Ver|Reg|2006-01-26|Unable to set threshold on appender via config fil|
|38406|Ver|Nor|2006-01-26|jdk1.4 dependencies in log4j 1.3 alpha            |
|38513|New|Nor|2006-02-05|[PATCH] Suggested unit test for JMSAppender       |
|38582|Ass|Nor|2006-02-08|Chainsaw does not include Receiver JavaDoc in dist|
|38590|Inf|Nor|2006-02-09|no space on device fails another instance         |
|38883|Opn|Nor|2006-03-07|LogFilePatternReceiver fails to process multi-line|
|39690|Inf|Cri|2006-05-31|Initialization fail in J2EE Environment           |
|39691|Ass|Nor|2006-05-31|DBAppender doesn't log long events                |
|40068|New|Nor|2006-07-18|Add support for attach-on-demand API to chainsaw  |
|40124|New|Min|2006-07-27|startup (JWS) does not initialize ignored elements|
|40251|Opn|Min|2006-08-14|Hard coded JMX domain name for MBean instances    |
|40382|Inf|Maj|2006-09-01|Sysappender hangs during boot time on HP          |
|40385|Inf|Maj|2006-09-01|SocketServer cannot find config file when passed a|
|40472|New|Nor|2006-09-11|SettingsManager calls loadSettings with global set|
|40533|New|Nor|2006-09-18|Chainsaw not showing all logging statements       |
|40570|Inf|Blk|2006-09-21|RollingFileAppender does not rollover when the fil|
|40611|New|Trv|2006-09-27|Bad subclass example; NullPointerException in Logg|
|40736|Inf|Nor|2006-10-11|log4j delete permission denied                    |
|40889|Inf|Nor|2006-11-03|repeated entries in log after failure             |
|40990|Inf|Nor|2006-11-17|Cannot bind port or ip address for outgoing UDP so|
|41006|Inf|Enh|2006-11-20|Contributing XMLSocketHubReceiver                 |
|41214|Ass|Maj|2006-12-19|Deadlock with RollingFileAppender                 |
|41311|Inf|Min|2007-01-06|Please make TimeBasedRollingPolicy non-final?     |
|41316|New|Nor|2007-01-08|NPE when using RollingFileAppender in Tomcat.     |
|41547|Inf|Nor|2007-02-05|PropertyConfigurator and layout.contentType       |
|41799|New|Enh|2007-03-09|SyslogAppender should enable to customize Log4j.Le|
|41882|Inf|Nor|2007-03-18|IE7 problems with Log4J web site                  |
|41937|New|Nor|2007-03-23|Logs from some panels missing in custom expression|
|41980|Inf|Maj|2007-03-29|Log4j stop updating log file- version log4j-1.2.8 |
|42189|Ass|Nor|2007-04-22|Add simple bridge for java.util.logging, with basi|
|42213|Opn|Blk|2007-04-24|log4j causing threads to stuck in weblogic        |
|42516|Inf|Nor|2007-05-24|Log4j failed to log file when packaged in Eclipse |
|42664|New|Enh|2007-06-14|JUL Appender                                      |
|42883|Opn|Nor|2007-07-12|'Welcome' and 'Drag & Drop' panels can't be hidden|
|42933|Inf|Maj|2007-07-18|IllegalStateException thrown from FileAppender.clo|
|43148|Ass|Nor|2007-08-16|LogFilePatternReceiver depends on jakarta-oro, cou|
|43277|New|Nor|2007-08-31|Add LogMF.entering, .exiting and .throwing methods|
|43282|Ass|Nor|2007-08-31|Add OSGi packaging info to log4j and companions   |
|43313|Ass|Nor|2007-09-05|log4j 1.2.16 release considerations and discussion|
|43403|Inf|Nor|2007-09-16|PatternLayout: new format modifer: prefix if non-e|
|43619|New|Enh|2007-10-13|Simple proposal for pluggable sys-props resolvers |
|43637|Inf|Nor|2007-10-16|SocketAppender.append(LoggingEvent) calls the Erro|
|43728|Inf|Cri|2007-10-29|Log file loss when specified file is locked by ano|
|43736|Ass|Nor|2007-10-30|Chainsaw does not honor encoding when loading XML |
|43820|New|Enh|2007-11-08|[PATCH] Layered Configurator Patch                |
|43879|Inf|Nor|2007-11-16|FileAppender writes Header multiple times         |
|43911|Inf|Nor|2007-11-20|logfiles not getting rolled over with RollingFileA|
|43923|Inf|Min|2007-11-21|JBOSS specific information in javadocs            |
|44219|Inf|Nor|2008-01-13|'WARNING' for a log level is silently ignored/chan|
|44308|New|Enh|2008-01-28|[Patch] JMX component for managing Logger configur|
|44370|Inf|Reg|2008-02-06|MANIFEST.MF broken in log4j-1.2.15.jar            |
|44386|Opn|Nor|2008-02-10|NTEventLogAppender.dll for windows 64             |
|44526|Inf|Nor|2008-03-04|segmentation fault occuring when PropertyConfigura|
|44557|Inf|Nor|2008-03-07|no close call to Appender after replacing the root|
|44649|Inf|Nor|2008-03-20|JMS Hangs when a Root Appender                    |
|44700|Inf|Nor|2008-03-28|Log4J locks rolled log files                      |
|44727|Inf|Nor|2008-04-01|Add missing Logger#isErrorEnabled and isWarningEna|
|44834|Inf|Nor|2008-04-17|SimpleSocketServer looses buffered logs, produces |
|44839|Inf|Nor|2008-04-17|SyslogAppender logging to a UNIX domain socket    |
|44932|New|Cri|2008-05-05|improve DailyRollingFileAppender handling of rotat|
|44934|Inf|Enh|2008-05-05|add helper method to DailyRollingFileAppender to g|
|44945|New|Nor|2008-05-06|SyslogAppender not working                        |
|45029|Ass|Nor|2008-05-18|Additional unit tests for Filters in extras compan|
|45042|New|Nor|2008-05-19|Need a reliable way to detect misconfiguration    |
|45109|Inf|Nor|2008-05-31|SMTPAppender uses wrong property for mail server  |
|45165|Ass|Enh|2008-06-09|Multifile Appender                                |
|45231|Ass|Nor|2008-06-18|Clear appenders call on logger calls a helper whic|
|45236|Inf|Cri|2008-06-19|Wriring output to an out-dated file.              |
|45304|Inf|Nor|2008-06-29|using log4j with OAS for some reasone all the logg|
|45482|Inf|Min|2008-07-25|Source contains unused variables                  |
|45629|New|Nor|2008-08-13|TopicConnection is not closed                     |
|45660|New|Enh|2008-08-20|NDC could remove Hashtable entry if Stack gets emp|
|45753|New|Nor|2008-09-06|Code contribution: BurstFilter for extras         |
|45781|New|Nor|2008-09-11|RollingFileAppender under Windows does not rotate |
|45855|New|Enh|2008-09-21|Add site/apt documentation for JULBridgeLogManager|
|45932|New|Nor|2008-10-01|Log4j JMX MBeans not cleaned up                   |
|45934|New|Enh|2008-10-02|FileAppender should use virtual-machine shutdown h|
|45939|New|Nor|2008-10-02|Cannot drop HierarchyDynamicMBean from LoggerRepos|
|46100|New|Enh|2008-10-27|NagiosAppender available for contribution         |
|46260|Inf|Nor|2008-11-21|RollingFileAppender and Tomcat has a strange behav|
|46426|Ass|Nor|2008-12-20|Implement commons-logging interfaces natively in l|
|46514|New|Nor|2009-01-12|provide API to re-init log4j                      |
|46533|New|Enh|2009-01-14|Deamon Thread                                     |
|46570|New|Nor|2009-01-20|DailyRollingFileAppender rolls logs into files dat|
|46573|Inf|Maj|2009-01-21|MDC attributes cant't be displayed on Chainsaw    |
|46592|Opn|Trv|2009-01-23|trim() on property file entries                   |
|46626|New|Enh|2009-01-29|Log4J 1.2.15 SyslogAppender doesn't not handle TAG|
|46691|New|Nor|2009-02-10|log4j file rolling over on restart of the server  |
|46804|New|Enh|2009-03-05|create the method PropertyConfigurator.configureAn|
|46868|New|Nor|2009-03-17|SocketHUBAppender: Allow restriction of binding to|
|46878|New|Cri|2009-03-19|Deadlock in 1.2.15 caused by AsyncAppender and Thr|
|46941|New|Enh|2009-03-31|Sub Level Logging Technique                       |
|46983|New|Enh|2009-04-07|More Debug output for log4j auto-configure request|
|47004|Inf|Nor|2009-04-08|log messages occasionally sharing a line          |
|47123|New|Blk|2009-04-29|TimeBasedRollingPolicy appends logs into a old log|
|47141|Inf|Enh|2009-05-02|add getCyclicBuffer() method to log4j SMTPAppender|
|47164|New|Enh|2009-05-07|HTMLLayout replace newline with <BR>              |
|47208|New|Enh|2009-05-17|Better Default colours for Log Panel Color Filter |
|47357|New|Min|2009-06-11|Declaring logger and category with same name cause|
|47575|Inf|Nor|2009-07-24|GZipping large files stops logging                |
|47595|Opn|Nor|2009-07-28|[companion] POMs of companions have problems      |
|47703|New|Nor|2009-08-18|Object rendering ought to be done outside synchron|
|47713|Inf|Nor|2009-08-20|SMTPAppender system properties propagation issue  |
|47740|Inf|Nor|2009-08-26|log4j 1.2.15 deadlock RootAppender NDC            |
|47883|New|Nor|2009-09-21|Lines dropped with UseNewHashFunction             |
|47898|Inf|Maj|2009-09-24|DailyRollingFileAppender unable to create backup l|
|47960|New|Min|2009-10-08|appender-ref children in appender element         |
|48027|Inf|Cri|2009-10-20|Logger statements in a particular class file is no|
|48141|Inf|Cri|2009-11-05|Log file rotation issue in Linux VM               |
|48188|New|Min|2009-11-12|Outdated reference to the 1.3 branch in FAQ       |
|48189|New|Trv|2009-11-12|Ceki Gülcü's name misspelled in the FAQ           |
|48209|New|Nor|2009-11-17|Websphere 6.0: logging statements appear in the SY|
|48216|New|Nor|2009-11-17|Dependency to javamail should be marked as optiona|
|48220|New|Min|2009-11-18|LoggingEvent.mdcCopy serialization with non-serial|
|48244|New|Min|2009-11-19|Socket Server configuration does not handle not re|
|48355|New|Cri|2009-12-08|Download page problems                            |
|48356|New|Nor|2009-12-08|Download page does not have link to KEYS file     |
|48365|New|Maj|2009-12-10|Log4J DailyRollingFileAppender sometimes does not |
|48430|New|Nor|2009-12-22|log4j:ERROR Write failure. java.io.IOException: St|
|48502|New|Cri|2010-01-07|Issue: Rotation file is not getting created - Roll|
|48527|New|Maj|2010-01-11|maven metadata is out of date                     |
|48583|New|Enh|2010-01-20|allow format of timestamp (first column of log fil|
|48588|New|Nor|2010-01-21|DOMConfigurator does not close input stream when c|
|48607|New|Cri|2010-01-25|Log levels are not displayed corectly             |
|48628|New|Min|2010-01-27|Download does not match md5sum                    |
|48679|New|Nor|2010-02-04|performance of getEffectiveLevel can be significan|
+-----+---+---+----------+--------------------------------------------------+
| Total  161 bugs                                                           |
+---------------------------------------------------------------------------+
bugzilla | 8 Feb 2010 20:30
Picon
Favicon

DO NOT REPLY [Bug 48704] New: Multiple Java Process in Cluster Logging to the same log file and rotating the same log file

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

           Summary: Multiple Java Process in Cluster Logging to the same
                    log file and rotating the same log file
           Product: Log4j
           Version: 1.2
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Keywords: APIBug
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev <at> logging.apache.org
        ReportedBy: aware24seven <at> gmail.com

This may already be a known issue.
When multiple java process log to the same log file and rotate the same log
file the process that gets to rotate the file first gets the change to write to
the new and most current log file and all other java processes continue to log
to the renamed, rotated file.

Scenario relevance : this probably should happen in any clustered environtment
where cluster members log to the same log file.

The issue seems to be happenning because the file writers in the other java
processes are still pointing to the old file that was renamed by the other java
process in a cluster.

So if there is an additional rollOver method, in the current RollOver classes,
that is cluster aware that checks the file writers in the appenders and
refreshes them before writing to a log file and also after rolling them over it
would be a great help to clustered environtments.

Otherwise developers may have to extend the appenders and add this
functionality and may have to update code everytime when Apache does a new
log4j release.

I have attached one such sample zip file with changed src code for reference.

Or if there is some other solution to this problem can someone pls update the
online documentation. Thanks !

--

-- 
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 | 10 Feb 2010 06:04
Picon
Favicon

DO NOT REPLY [Bug 48704] Multiple Java Process in Cluster Logging to the same log file and rotating the same log file

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

--- Comment #1 from Curt Arnold <carnold <at> apache.org> 2010-02-09 21:04:43 UTC ---
You are correct that it is a known issue.  I don't have the time at the moment
to check which bug I should mark this as a duplicate.

The unavoidable issue (at least for anything derived from WriterAppender) is
that java.io provides no mechanism to synchronize file writing between multiple
JVM's or even multiple FileOutputStreams within a single JVM's.

Most of the time when people configure multiple appender to write to the same
file, everything seems to work.  However, they are depending on implementation
details.  Things do go spectacularly wrong with the RFA's as you have noticed.

There is no way to reliably address this using java.io.  The right thing to do
would be to write a RFA replacement using java.nio which has been on my wish
list for years now.

--

-- 
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 | 10 Feb 2010 06:19
Picon
Favicon

DO NOT REPLY [Bug 48704] Multiple Java Process in Cluster Logging to the same log file and rotating the same log file

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

--- Comment #2 from Jess Holle <jessh <at> ptc.com> 2010-02-09 21:19:15 UTC ---
Or you just avoid the contention of trying to share one log file across
multiple processes, e.g. by using process id (and host name as needed) in the
log file name.  [The process id is readily available in Java 5 and higher.]

--

-- 
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 | 10 Feb 2010 09:51
Picon
Favicon

DO NOT REPLY [Bug 48704] Multiple Java Process in Cluster Logging to the same log file and rotating the same log file

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

--- Comment #3 from Ceki Gulcu <ceki <at> apache.org> 2010-02-10 00:51:04 UTC ---
Alternatively, you could use logback, log4j's successor, which supports having
multiple JVMs writing to the same file. See prudent mode [1] for details.

[1] http://logback.qos.ch/manual/appenders.html#prudent

--

-- 
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 | 10 Feb 2010 18:12
Picon
Gravatar

Re: Future development of Log4J?

Hi all,

I would like to bring up the old discussion on future Log4J
development again. I think christmas killed it before there was an
satisfying conclusion. I was basically asking if Log4J is dead or not;
several opinions rose. There is logback as a stable project,
implementing the meanwhile wellknown SLF4J API.

Curt showed me a bunch of mails/tickets in Jira for a possible
redesign of Log4J known as 2.0

On Sat, Dec 12, 2009 at 7:33 PM, Curt Arnold <carnold <at> apache.org> wrote:
> The JIRA tracker for log4j2 has captured some potential design goals at http://issues.apache.org/jira/browse/LOG4J2.
>
> Here are some posts to start as a reading list for the backstory (reverse chronological order):
>
> http://marc.info/?l=log4j-user&m=125725041724346&w=2
> http://marc.info/?t=122830451800001&r=1&w=2
> http://marc.info/?t=121385743100001&r=1&w=2
> http://marc.info/?t=121094847000005&r=1&w=2
>
> That should be enough to get started as they should contain links to older articles.

Some people thought it might be a good idea to continue because of
f.e. the Apache community model. Other said that might be a waste of
time.

Log4J in my opinion is near to the attic, if there is no development
activity. I would think this would be pretty said and I am willing to
spend some time. But I cannot lead the development - there are others
who were involved in tons of discussions in the past.

Question: are some more interested developers subscribed to this list
who are willing to work on Log4J 2.0 again?

Cheers,
Christian

Gmane