From 52bb71582bcff166469b8a8be0960a24bc3f02b7 Mon Sep 17 00:00:00 2001 From: Maarten Mulders Date: Sat, 8 Feb 2014 21:03:17 +0100 Subject: Explained how to customise the category of the generated Log(ger) --- usage_examples/LogExample_post.jpage | 8 ++++++++ usage_examples/LogExample_pre.jpage | 8 ++++++++ website/features/Log.html | 2 ++ 3 files changed, 18 insertions(+) diff --git a/usage_examples/LogExample_post.jpage b/usage_examples/LogExample_post.jpage index 4ab35b08..eab3b046 100644 --- a/usage_examples/LogExample_post.jpage +++ b/usage_examples/LogExample_post.jpage @@ -13,3 +13,11 @@ public class LogExampleOther { log.error("Something else is wrong here"); } } + +public class LogExampleCategory { + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("CounterLog"); + + public static void main(String... args) { + log.error("Calling the 'CounterLog' with a message"); + } +} diff --git a/usage_examples/LogExample_pre.jpage b/usage_examples/LogExample_pre.jpage index 196a9047..fa746dba 100644 --- a/usage_examples/LogExample_pre.jpage +++ b/usage_examples/LogExample_pre.jpage @@ -16,3 +16,11 @@ public class LogExampleOther { log.error("Something else is wrong here"); } } + +@CommonsLog("CounterLog") +public class LogExampleCategory { + + public static void main(String... args) { + log.error("Calling the 'CounterLog' with a message"); + } +} diff --git a/website/features/Log.html b/website/features/Log.html index f92af1e3..e6b3ece6 100644 --- a/website/features/Log.html +++ b/website/features/Log.html @@ -33,6 +33,8 @@
@XSlf4j
Creates private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LogExample.class);
+

+ By default, the category (or name) of the logger will be the type where the annotation was placed. This can be customised by specifying a value for the category.

-- cgit