
One other question: String user = "chris"; log.debug("User {} is requesting system logs", user ); the log output I get is: User {} is requesting system logs So, clearly, parameterized logging is not working. I'm using logback classic 0.9.27 with slf4j api 1.6.1 and a bunch of other stuff to catch j.u.l and j.c.l. It looks like parameterized logging has been there for a long time though. It should be just that simple, shouldn't it?

On 08/03/2011 10:40 PM, Christopher Piggott wrote:
One other question: String user = "chris"; log.debug("User {} is requesting system logs", user );
the log output I get is:
User {} is requesting system logs
So, clearly, parameterized logging is not working. I'm using logback classic 0.9.27 with slf4j api 1.6.1 and a bunch of other stuff to catch j.u.l and j.c.l.
It looks like parameterized logging has been there for a long time though.
It should be just that simple, shouldn't it?
What type is the log object? Can you send the output of the following? System.out.println(log.getClass()); -- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. If interested, please email your resume to hr@qos.ch.

log.getClass() reports, it's a ch.qos.logback.classic.Logger. I obtained the logger this way; import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(LogResource.class); On Tue, Mar 8, 2011 at 4:43 PM, Ceki Gülcü <ceki@qos.ch> wrote:
On 08/03/2011 10:40 PM, Christopher Piggott wrote:
One other question: String user = "chris"; log.debug("User {} is requesting system logs", user );
the log output I get is:
User {} is requesting system logs
So, clearly, parameterized logging is not working. I'm using logback classic 0.9.27 with slf4j api 1.6.1 and a bunch of other stuff to catch j.u.l and j.c.l.
It looks like parameterized logging has been there for a long time though.
It should be just that simple, shouldn't it?
What type is the log object? Can you send the output of the following?
System.out.println(log.getClass());
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. If interested, please email your resume to hr@qos.ch. _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

The following test case import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class A { @Test public void a() { Logger log = LoggerFactory.getLogger(A.class); String user = "chris"; log.debug("User {} is requesting system logs", user ); } } produces: 22:57:30.814 [main] DEBUG A - User chris is requesting system logs I've got logback-classic, logback-core and slf4j-api on my classpath. n 08/03/2011 10:53 PM, Christopher Piggott wrote:
log.getClass() reports, it's a ch.qos.logback.classic.Logger. I obtained the logger this way;
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
private static final Logger log = LoggerFactory.getLogger(LogResource.class);
On Tue, Mar 8, 2011 at 4:43 PM, Ceki Gülcü<ceki@qos.ch> wrote:
On 08/03/2011 10:40 PM, Christopher Piggott wrote:
One other question: String user = "chris"; log.debug("User {} is requesting system logs", user );
the log output I get is:
User {} is requesting system logs
So, clearly, parameterized logging is not working. I'm using logback classic 0.9.27 with slf4j api 1.6.1 and a bunch of other stuff to catch j.u.l and j.c.l.
It looks like parameterized logging has been there for a long time though.
It should be just that simple, shouldn't it?
What type is the log object? Can you send the output of the following?
System.out.println(log.getClass());
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html

Oh, you know what ... to the appenders that I did NOT write myself it works: log.debug("Hi {}", "chris"); -> 08 Mar 2011 16:56:36.468 DEBUG - com.something.LogResource Hi chris so the problem is that my home brew Appender (extends AppenderBase) stinks. On Tue, Mar 8, 2011 at 4:53 PM, Christopher Piggott <cpiggott@gmail.com> wrote:
log.getClass() reports, it's a ch.qos.logback.classic.Logger. I obtained the logger this way;
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
private static final Logger log = LoggerFactory.getLogger(LogResource.class);
On Tue, Mar 8, 2011 at 4:43 PM, Ceki Gülcü <ceki@qos.ch> wrote:
On 08/03/2011 10:40 PM, Christopher Piggott wrote:
One other question: String user = "chris"; log.debug("User {} is requesting system logs", user );
the log output I get is:
User {} is requesting system logs
So, clearly, parameterized logging is not working. I'm using logback classic 0.9.27 with slf4j api 1.6.1 and a bunch of other stuff to catch j.u.l and j.c.l.
It looks like parameterized logging has been there for a long time though.
It should be just that simple, shouldn't it?
What type is the log object? Can you send the output of the following?
System.out.println(log.getClass());
-- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. If interested, please email your resume to hr@qos.ch. _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

On 08/03/2011 11:00 PM, Christopher Piggott wrote:
Oh, you know what ... to the appenders that I did NOT write myself it works:
log.debug("Hi {}", "chris"); -> 08 Mar 2011 16:56:36.468 DEBUG - com.something.LogResource Hi chris
so the problem is that my home brew Appender (extends AppenderBase) stinks.
You want to to call getFormattedMessage() on ILoggingEvent. -- QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, is looking to hire talented software developers. For further details, see http://logback.qos.ch/job.html

Namasthe, I have been using logback for some time now. I find it very good. Earlier I was using log4j. I have one comment on logback: Currently I find the packing of logback very confusing. There are too many jar files for me to track (say logback : access, classic, core) , then I have to deal with plethora of jars in slf4j (simple, nop, etc). While these packages may have evolved over time to give flexibility to the logging solution. I find it very hard to keep track of what is required when. I get binging exceptions from the resulting confusion. My suggestion is it would be really great if there is only one logback.jar that has all the functionality to meet the basic logging needs such as logging to console, rolling file, smtp. This will help to resolve the complexities of the jar in logback solution. Regards Rathna ======================================================== Rathnadhar.K.V "Aham Brahmasmi" Brhadaranyaka Upanishad 1.4.10 ======================================================== Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
participants (3)
-
Ceki Gülcü
-
Christopher Piggott
-
rathnadhar.kolar@wipro.com