Yong-Loh | 2 Mar 09:23 2010

log4j extras : issue with zipping


Hi All,

We are using log4j 1.2.15 and log4j-extras-1.0. Our requirement is to roll
the log file based on size and the old files need to be compressed. To do
this, We are using RollingFileAppender in extras companion. The problem that
we are facing is..some files are zipped and some are not zipped at all.

Did anybody face the similar issue? Is it a known issue with log4j-extras or
something todo with the log4j configuration?

Below is our log4j.xml. Any pointers in resolving this issue would be of
great help.

<appender name="FILEAPPENDER"
class="org.apache.log4j.rolling.RollingFileAppender">

        

        <rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
      		
	  		
	  		
    	</rollingPolicy>
	
		<triggeringPolicy
class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
	  		
	   	</triggeringPolicy>
(Continue reading)

Yong-Loh | 2 Mar 10:16 2010

Re: log4j extras : issue with zipping


Hi,

I think, some of the entries in the log4j.xml are not seen in the earlier
post. So, posting it agian.

<appender name="FILEAPPENDER"
class="org.apache.log4j.rolling.RollingFileAppender">
        <  param name="file" value="${catalina.base}/bin/logs/test.log" />
        < param name="append" value="true" />
        < param name="encoding" value="UTF-8" />
        <rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
      	    < param name="FileNamePattern"
value="${catalina.base}/bin/logs/test.%i.log.zip" />
	    < param name="MaxIndex" value="5"/>
	    < param name="MinIndex" value="1"/>
        </rollingPolicy>
	
<triggeringPolicy
class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
	< param name="MaxFileSize" value="5120"/>
</triggeringPolicy>
           	
        <layout class="org.apache.log4j.PatternLayout">
           	< param name="ConversionPattern" value="%d %p [%c] - %m%n" />
        </layout>
</appender>

Thanks & Regards,
(Continue reading)

David Dabbs | 2 Mar 22:38 2010
Picon

Log4j 1.2.16

Has this been shelved?
Wendal Chen | 3 Mar 09:37 2010
Picon

Re: Log4j 1.2.16

maybe

2010/3/3 David Dabbs <dmdabbs <at> gmail.com>:
> Has this been shelved?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe <at> logging.apache.org
> For additional commands, e-mail: log4j-user-help <at> logging.apache.org
>
>
Curt Arnold | 4 Mar 01:27 2010
Picon

Re: Log4j 1.2.16


On Mar 2, 2010, at 3:38 PM, David Dabbs wrote:

> Has this been shelved?
> 

Some other issues came up during my last window of availability to push to release.  I expect to try again to
get a release candidate out either this weekend or next.
Ryan Connolly | 4 Mar 15:55 2010
Picon

Help with NTEventLogAppender

Hello,
     I am successfully using the NTEventLogAppender in my application to log
to the Windows Event Logs and output is showing up in the "Application" log.
I am hoping someone may be able to tell me how I might be able to change the
log that my application logs to.  For example, I would like to create a new
log in the Event Viewer that contains only messages from my application.
Can this be done, and if so, how might I go about accomplishing this?

Any and all help is greatly appreciated!

Thanks in advance,
-Ryan
David Dabbs | 4 Mar 17:45 2010
Picon

Re: Log4j 1.2.16

Thanks for the update.

On Wed, Mar 3, 2010 at 6:27 PM, Curt Arnold <carnold <at> apache.org> wrote:

>
> On Mar 2, 2010, at 3:38 PM, David Dabbs wrote:
>
> > Has this been shelved?
> >
>
> Some other issues came up during my last window of availability to push to
> release.  I expect to try again to get a release candidate out either this
> weekend or next.
>
>
>
mhanda | 9 Mar 00:53 2010

Log4j Grouping application logs


Hi,

I am trying to group logs of multiple related applications to a single log
file.

For example I have 3 applications A1.esb, A2.esb, A3.esb.

I want all the logs from these 3 applications get logged to a single log
file called A.log.

Similarly, I want B.log for B1.esb, B2.esb and B3.esb.

I am using log4j in JBoss application server.

I have tried to use TCLFilter but I only succeeded in getting individual
applications logging to individual log files. As in, A1.esb logging to
A1.log, A2.esb logging to A2.log and so on. But I couldn't figure out a way
of grouping these loggings.
--

-- 
View this message in context: http://old.nabble.com/Log4j-Grouping-application-logs-tp27829507p27829507.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Stefano Nichele | 10 Mar 17:37 2010
Picon

why AppenderSkeleton.doAppend is synchronized ?

Hi all,
looking for perfomance issue in my server application, I found that 
AppenderSkeleton.doAppend method is synchronized.
I google a bit and I have found some messages but not a clear anwser to 
my doubt: why that method is synchronized ? it seems that just check the 
threshold, the filter and that "append" the event but in this way is 
serializing all log calls. I'm logging events on the db and also using 
AsyncAppender + my own appender I'm not able to obtain good performance 
since just one thread at time can append (insert) an event and the 
AsyncAppender queue grows pretty quick.

For sure i'm missing something...could you help me to understand the 
root reason for having it synchronized ? I'm thinking to have my owm 
implementation of AppenderSkeleton removing synchronization but I'm not 
sure if there are drawbacks that im not taking in consideration.

Thanks a lot in advance
ste
Curt Arnold | 11 Mar 06:00 2010
Picon

Re: why AppenderSkeleton.doAppend is synchronized ?


On Mar 10, 2010, at 10:37 AM, Stefano Nichele wrote:

> Hi all,
> looking for perfomance issue in my server application, I found that AppenderSkeleton.doAppend method
is synchronized.
> I google a bit and I have found some messages but not a clear anwser to my doubt: why that method is
synchronized ? it seems that just check the threshold, the filter and that "append" the event but in this
way is serializing all log calls. I'm logging events on the db and also using AsyncAppender + my own
appender I'm not able to obtain good performance since just one thread at time can append (insert) an event
and the AsyncAppender queue grows pretty quick.
> 
> For sure i'm missing something...could you help me to understand the root reason for having it
synchronized ? I'm thinking to have my owm implementation of AppenderSkeleton removing
synchronization but I'm not sure if there are drawbacks that im not taking in consideration.
> 
> Thanks a lot in advance
> ste
> 
> 

log4j 1.2 was designed a long time ago and relies on that big lock to provide thread safety.  Other classes in
log4j (layouts, appenders and the like) were designed assuming that they would be externally
synchronized by that lock and likely not safe if that lock is bypassed.

You could either implement the Appender interface or extend AppenderSkeleton but override doAppend
(copying and pasting the implementation but without the synchronized modifier, but all appenders,
layouts, etc used must be able to operate safely without that lock.

Addressing this issue is one of the core design goals for log4j 2.0 (http://issues.apache.org/jira/browse/LOG4J2-3)
(Continue reading)


Gmane