logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin.Guenth...@Compart.net
Subject New logger needs help: tracing with NCDs
Date Wed, 10 Jan 2001 09:24:57 GMT
Hi there,

I wonder if it is possible to do the following with log4j:

I would like to trace in a kind of transaction based environment.

Meaning: when a new transaction(*) starts, I would like to
create a trace stack. During the transaction, all trace messages
should be cached on this stack - but they should not be emitted.

When the transaction ends there should be two possibilities:
- transaction fails:
    emit all messages that have been cached in the stack
- transaction succeeds
    throw away the stack and all its messages

I think the underlying idea is quite useful: if there is no problem, I dont
need to see any message. If there is a problem, I will receive
all messages that belong to the context of the problem.

I had a look at org.log4j.NDC; but I fear that is not exactly what I am
looking for. I am wondering if I can achieve my goal by writting own
appenders ... so please tell me what you think: is it possible to
implement such functionality using log4j?


edwin g√ľnthner

(*) a transaction is just a set of actions that belong together; it might
  happen in its own thread

View raw message