Re: [PROPOSAL] Implementing the SLF4J API directly

2008-12-15 Thread Thorbjørn Ravn Andersen

Ceki Gulcu skrev  den 15-12-2008 11:19:


Sure. SLF4J delegates to log4j (via slf4j-log4j12.jar). I now realize
that the instructions in my mail of 12-12-2008 did not mention
slf4j-log4j12.jar. Did you add slf4j-log4j12.jar to your class path?

I must have.  I just didn't remember to check before responding to the 
mail, and thought I missed something in the process.  Thank you.


I am not doubting, just not understanding, there is a difference O:)

--
 Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"


-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[Fwd: Board report]

2008-12-15 Thread Ceki Gulcu

FYI

--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
--- Begin Message ---

Curt,

I would like to respond to your Apache Logging Project board report
that you filed a few hours ago, in particular because it has been
filed with the board before this PMC had a chance to comment on it.

Would you care to explain why you have not consulted with this PMC?
Were you planning on sending the Apache Logging PMC a copy of your report?

In any case, could you please forward a copy to this PMC so that it
can be commented upon?

Thank you in advance,

--
Ceki Gülcü


--- End Message ---
-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Re: [PROPOSAL] Implementing the SLF4J API directly

2008-12-15 Thread Ceki Gulcu



Thorbjørn Ravn Andersen wrote:

Ceki Gulcu skrev  den 12-12-2008 16:01:

To run this test, in addition to junit4.jar, you need to have
slf4j-api.jar, apache-log4j-extras-1.1-SNAPSHOT.jar and log4j.jar on
your class path.

On my machine the output is:
LogMF avg=15251
SLF4J avg=4964



On my machine (which is low on RAM) I get these numbers with JDK 1.5

SLF4J avg=6085
LogMF avg=12582

I understand how you get the LogMF method to write to ytest.log, but not 
how the slf4j method does it.

Would you care to elaborate?


Sure. SLF4J delegates to log4j (via slf4j-log4j12.jar). I now realize
that the instructions in my mail of 12-12-2008 did not mention
slf4j-log4j12.jar. Did you add slf4j-log4j12.jar to your class path?

To check that the testSLF4J actually writes to ytest.log via log4j,
disable "testLogMF()" by adding the @Ignore annotation before the
testLogMF() method. You should see that ytest.log file increases in
size as testSLF4J() logs into it via log4j, as it should. (If you have
any lingering doubts that log4j is the underlying framework, you can
run the tests in a debugger.)


This shows that an enabled logging statement runs three times faster
when logging via SLF4J than when logging through LogMF, with log4j as
the underlying logging framework. Not only is the SLF4J formatter
faster, it makes a "noticeable" difference when the logs are actually
written to destination.


This is a very substantial difference, so if the LogMF approach is to be 
used some kind of mechanism should be used to optimize - a weak 
reference cache of the MessageFormatter with the format string as key - 
but if the simpler approach is faster I would personally go with that.



--
Ceki Gülcü

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



Re: [PROPOSAL] Implementing the SLF4J API directly

2008-12-15 Thread Thorbjørn Ravn Andersen

Ceki Gulcu skrev  den 12-12-2008 16:01:

To run this test, in addition to junit4.jar, you need to have
slf4j-api.jar, apache-log4j-extras-1.1-SNAPSHOT.jar and log4j.jar on
your class path.

On my machine the output is:
LogMF avg=15251
SLF4J avg=4964



On my machine (which is low on RAM) I get these numbers with JDK 1.5

SLF4J avg=6085
LogMF avg=12582

I understand how you get the LogMF method to write to ytest.log, but not 
how the slf4j method does it.

Would you care to elaborate?


This shows that an enabled logging statement runs three times faster
when logging via SLF4J than when logging through LogMF, with log4j as
the underlying logging framework. Not only is the SLF4J formatter
faster, it makes a "noticeable" difference when the logs are actually
written to destination.
This is a very substantial difference, so if the LogMF approach is to be 
used some kind of mechanism should be used to optimize - a weak 
reference cache of the MessageFormatter with the format string as key - 
but if the simpler approach is faster I would personally go with that.


--
 Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"


-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org