Scott,
It didn´t work!
My pattern has %m%n at the end, but i think that the MESSAGE continuous
to be the corret tag to put on chainsaw...isn´t it?!
I didn´t forget to define the timestampFormat... :)
Than you!!!
Gabriel
Scott Deboy <[EMAIL PROTECTED]> escrev
Assuming you don't have spaces at the beginning of entries, and assuming you
really have %m as the end of your pattern layout, for example:
%d {dd/MM HH:mm:ss,SSS} u=%X{USUARIO} %c{1} - %m
This logFormat works:
TIMESTAMP u=PROP(USARIO) LOGGER - MESSAGE
You also need to define the timestampFormat
Very nice, indeed, but it doesn't apply to existing logging code neither...
Heri
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 19, 2006 6:33 PM
> To: log4j-user@logging.apache.org
> Subject: RE: High performance filters
>
>
> I tried
Yeah! Sorry I forgot to put in the last message :)
19/07 09:42:28,829 u=L020136 GravadorLogMQBean - Gravou Log: TipoMovimento
[850004] Fila: [mqLog] Log: [88496654085000420060719094221014950010660L020136
96604081099.247.163.01299
1501495067011190104943162000600800035964
Can you also provide some of output.log's contents as well?
-Original Message-
From: Gabriel Nascimento [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 9:40 AM
To: Log4J Users List
Subject: RE: Chainsaw
Okay!!
log4j.appender.fileLog=org.apache.log4j.RollingFileAppender
Okay!!
log4j.appender.fileLog=org.apache.log4j.RollingFileAppender
# nome do arquivo de log da efl
log4j.appender.fileLog.File=temp/output.log
# Controla o tamanho maximo do arquivo
log4j.appender.fileLog.MaxFileSize=1000KB
# Faz backup dos arquivos de log (apenas 1)
log4j.appen
I tried and this solution works like a charm!
Log4j designers are really clever guys :)
>-Original Message-
>From: ext
>[EMAIL PROTECTED]
>ache.org
>[mailto:[EMAIL PROTECTED]
>gging.apache.org]
>Sent: Wednesday, July 19, 2006 6:26 PM
>To: log4j-user@logging.apache.org
>Subject: RE: High
After an extra look at log4j source I wonder if I've found some kind of
solution:
Logger contains the following signature:
log.debug(Object message)
Here this is an "Ojbject" and not a "String".
If I create some class in charge of building the debug message only when its
toString() method is c
It would really only work with 1 extra criteria.
I don't know the impact of many loggers.
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
That's an interresting work arround.
Still that is tedious when several criterias are needed.
Since we are talking about a server, that would create
Correct. I thought you were concerned about the layout generating the
final message.
The only two options that come to mind do require changing the code
(changing the logger name to include the IP address or creating your
own isDebugEnabled that checks the IP in the NDC).
On 7/19/06, [EMAIL PRO
That's an interresting work arround.
Still that is tedious when several criterias are needed.
Since we are talking about a server, that would create a huge number of
loggers. Do you have any idea about performance impact?
>-Original Message-
>From: ext James Stauffer [mailto:[EMAIL PROTE
I believe this is not necessary. Using a NDC and a Filter impl (the
log4j_sandbox NDCMatchFilter e.g.) would do the same if I'm correct.
But still it does not prevent the application (that is the buildDebugMessage()
call) from building the debug message, which is quite CPU intensive.
>-Origi
Another option would be to write your own appender which filters
before creating the message and if it passes then sends it to a normal
appender.
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
This is the kind of answer I was afraid of ;)
But that is a very powerfull feature some of o
I would write a helper class with a static interface:
public boolean static isLoggingEnabled( Logger aLog, Level aLevel ) { ... }
where you check your conditions. The call within code could the look like:
NDC.push("source-ip=" + request.getSourceAddress());
if (MyLogHelper.isLoggingEna
One option would be to include to the IP address in the logger name.
Logger log = Logger.getLogger(getClass().getName() + "." +
request.getSourceAddress());
That would create many more loggers but would allow
log.isDebugEnabled() to work correctly.
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED
This is the kind of answer I was afraid of ;)
But that is a very powerfull feature some of our (large) customers are asking
for very loudly: it gives both debug messages and good-enough performance for
live systems.
Sure I could do it myself, but then that would not apply to already existing
l
Interesting alternative. Right now my problem is kinda solved and I'm moving
on to other diferent aspects of my application. But I'll take a look at
org.apache.commons at any free time I have. It looks interesting. Thanks!
2006/7/19, James Stauffer <[EMAIL PROTECTED]>:
You could use org.apache.
If you provide the text of your log4j.xml and some sample log output, I can see
what I can do.
-Original Message-
From: Gabriel Nascimento [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2006 8:10 AM
To: log4j-user@logging.apache.org
Subject: Chainsaw
Please,
I´m having dificul
Please,
I´m having dificulty to write my logFormat to put in my
LogFilePatternReceiver. My log4j.xml has the following ConversionPattern: %d
{dd/MM HH:mm:ss,SSS} u=%X{USUARIO} %c{1} -%
Could you help me?
Thanks!!
-
Yahoo! Acesso Grátis - I
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I hope this is clear enough :)
It is, and your problem looks very non-trivial :)
To me, it looks like you need to implement your own filtering before
invoking buildDebugMessage(), since to access the log4j framework you
need to pass an o
I'm not sure your proposal solves my problem.
I'm sorry if my question was not clear enough. Let me try another way:
Considering the following code snippet
// the following method is called-back hundred of time
// per second.
public void process(Request request, Response response)
{
NDC.push(
You could use org.apache.commons.lang.StringUtils.replace(String text,
String repl, String with) or the following:
public static String Replace(String original, String from, String to) {
if(original == null) {
original = "";
}
if(from == null) {
from
Create separate Loggers for the debug requests, and leave only those
loggers at debug level. Then prepend log.debug() calls with
if(log.isDebugEnabled()), so that the debug messages will only be
created if the particular logger is debug enabled.
(I'm not sure I understood your question correctly,
Hi all,
I'm building some kind of server and I use log4j for logging.
For troubleshooting issue I whant to be able to debug some few requests
only (based on matching criterias) so that it is possible to debug live
servers without killing performances.
I managed to use NDC and filters to do that a
24 matches
Mail list logo