Renan Vinícius Mozone | 4 Dec 2009 18:49
Picon

Using MDC on an application server with thread pools

    On my web application (it uses JSP pages) I'm using the MDC to put the
the sessionid on the log records, but i'm facing a problem. The application
server is IBM WebSphere 6.1 and it uses thread pools. So, sometimes, the
thread for some sessions is changed (the pool allocate another thread to
continue the session) and since the MDC is thread based, in this cases I'm
getting a incorrect session on the log records. The log's are scrambled now.

    Any suggestions?
Yogesh Rao | 4 Dec 2009 20:05
Favicon

RE: Using MDC on an application server with thread pools

Hi,

Servers never guarantees that thread allocated to a request from client would be given the same thread on
subsequent requests from the client. Hence its advisable to clear out the mdc info before the request
ends(preferable)or in case you wouldn't like to clean up then make sure you overwrite it every time to get
the correct output.

Hope this helps!!

Cheers!

-----Original Message-----
From: Renan Vinícius Mozone [mailto:renan.mozone <at> gmail.com]
Sent: Fri 12/4/2009 11:19 PM
To: log4j-user
Subject: Using MDC on an application server with thread pools

    On my web application (it uses JSP pages) I'm using the MDC to put the
the sessionid on the log records, but i'm facing a problem. The application
server is IBM WebSphere 6.1 and it uses thread pools. So, sometimes, the
thread for some sessions is changed (the pool allocate another thread to
continue the session) and since the MDC is thread based, in this cases I'm
getting a incorrect session on the log records. The log's are scrambled now.

    Any suggestions?

Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its
customers and is intended 
for use only by the individual or entity to which it is addressed, and may contain information that is
privileged, confidential or 
(Continue reading)

JOSE L MARTINEZ-AVIAL | 4 Dec 2009 20:57
Picon

Fwd: Concatenate DailyRollingFileAppender and SMTPAppender

Hello,
    Does anyone know if it's possible to "concatenate" two appenders? I have
setup a DRFA that rollovers at midnight, and I'd like it to send the file it
generates by mail to a certain mail address. I know I can modify the DRFA to
do that, but I wonder if such behaviour is already contemplated in the
log4j? Has anyone done something like this?

   thanks

JL
Curt Arnold | 5 Dec 2009 04:26
Picon
Favicon

Re: Concatenate DailyRollingFileAppender and SMTPAppender

The RollingFileAppender framework in the extras companion
(http://logging.apache.org/log4j/companions/extras/index.html) would be a better starting
point.  Much more designed for extensibility than DailyRollingFileAppender but offers the same
features when properly configured.  You should be able to replace the rolling policy with an extended one
that does what you want.

As for an existing solution, I'm not aware of one, but I wouldn't be surprised if someone pointed you to one in
the new day or so.

On Dec 4, 2009, at 1:57 PM, JOSE L MARTINEZ-AVIAL wrote:

> Hello,
>    Does anyone know if it's possible to "concatenate" two appenders? I have
> setup a DRFA that rollovers at midnight, and I'd like it to send the file it
> generates by mail to a certain mail address. I know I can modify the DRFA to
> do that, but I wonder if such behaviour is already contemplated in the
> log4j? Has anyone done something like this?
> 
>   thanks
> 
> JL
Ohad Ben Porat | 6 Dec 2009 17:30
Favicon

DailyRollingFileAppender - Every X minutes?

Hey,

I am using the DailyRollingFileAppender in my program and I wish to roll files every 15 minutes but failed to
find a way to do so.
Is there a way to configure the DatePattern to trigger file rolling every X minutes? Or is it truly only
capable of rolling every single unit time (1 minutes, 1 hour etc... ) ?

Every help is appreciated,
Thanks.
Curt Arnold | 7 Dec 2009 03:50
Picon
Favicon

Re: DailyRollingFileAppender - Every X minutes?

I can't think of one, but you should be able to do it with the
org.apache.log4j.rolling.RollingFileAppender in the extras companion
(http://logging.apache.org/log4j/companions/extras) using a custom triggering policy.

On Dec 6, 2009, at 10:30 AM, Ohad Ben Porat wrote:

> Hey,
> 
> I am using the DailyRollingFileAppender in my program and I wish to roll files every 15 minutes but failed
to find a way to do so.
> Is there a way to configure the DatePattern to trigger file rolling every X minutes? Or is it truly only
capable of rolling every single unit time (1 minutes, 1 hour etc... ) ?
> 
> Every help is appreciated,
> Thanks.
mc1392 | 8 Dec 2009 22:48
Favicon

DailyRollingFileAppender


Is there any way to get the log entries to have the most recent on top?
Currently I am using html layout and the newest entry ends up at the bottom
of the file.
I'd like the newest on top.

--

-- 
View this message in context: http://old.nabble.com/DailyRollingFileAppender-tp26701419p26701419.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
Michael Erskine | 9 Dec 2009 11:17

RE: DailyRollingFileAppender

> Is there any way to get the log entries to have the most recent on top?
> Currently I am using html layout and the newest entry ends up at the bottom
> of the file.
> I'd like the newest on top.

Turn your screen upside down :)

Seriously though - I don't mean to poke fun but there's a proliferation of posts asking for esoteric
"features" that belong elsewhere. Can the users of libraries no longer write code?

BTW: I'm sure you could log to LF5 and have it display the most recent log entry first. Personally I'd use tail
and sort on a plain text log or write a custom appender that is a "prepender" with an ajax servlet if I wanted
to get fancy web output.

Regards,
Michael Erskine.
NearMiss NearMiss | 10 Dec 2009 16:01
Picon

Specifying TAG When Logging to Syslog

Is it possible to specify a TAG value when sending to syslog via log4j,
similar to logger's -t option?
Habermann, Tobias | 11 Dec 2009 15:00
Picon
Picon
Favicon

RollingFileAppender but keeping some data

Hi
I am using log4j in a Controlsystem GUI to log different hardware states (e.g. temperatures, pressure,
etc.). The user needs to have access to = the data from the last 4 days always. To display the data I read it
from = the logfiles. Right now I use a simple FileAppender. But after some time = the files get very big. I
would like to have something like a = RollingFileAppender that archives the log file but instead of
starting a = new File, it should always keep the data from the last 4 days in the file.=20 Maybe I should
mention that I am not a java expert.=20 Is there a simple way to implement this?=20 Should I overwrite the
RollingFileAppender.rollOver() ?
Or should I stay with the FileAppender and write an independent class = that opens the logfile and removes
any entries that are older than 4 = days?

Regards
Tobias Habermann

--

-- 
GSI Helmholtzzentrum für Schwerionenforschung GmbH
Planckstraße 1
D-64291 Darmstadt
www.gsi.de
Gesellschaft mit beschränkter Haftung
Sitz der Gesellschaft: Darmstadt
Handelsregister: Amtsgericht Darmstadt, HRB 1528

Geschäftsführung: Professor Dr. Dr. h.c. Horst Stöcker, Christiane Neumann

Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph
Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt

Gmane