Julius Davies wrote:
On Tue, Jun 10, 2008 at 10:41 PM, Lilianne E. Blaze
<[EMAIL PROTECTED]> wrote:
Hello,
One more thing - why should "A Log Rotation Best Practice That Is Currently
Not Possible" be impossible?
Either
1) Implement it extending rolling file appender. Should be reasonably easy.
Disadvantage - tied to a speficic api.
Yes!!!! And now I'm waiting for your patch..... :-p
I have a log4j version more or less ready, implemented as PatternLayout
subclass.
Example output, compact version:
2008-06-24/03:32:20.625/CEST INFO [main] na (?:?) - app="my app"
userHome=C:\Users\LBlaze UPTIME=[0:0.172] RUNTIME=[Java(TM) SE Runtime
Environment 1.6.0_10-beta-b25] VM=[Java HotSpot(TM) Client VM 11.0-b12]
SYSTEM=[Windows XP 5.1 x86] MEMORY=[521KiB(10%/1%)/5MiB(8%)/64MiB]
2008-06-24/03:32:20.625/CEST INFO [main]
net.lilianne_blaze.logging.log4j.HeaderPatternLayoutTest
(HeaderPatternLayoutTest.java:44) - Testing compact log4j output.
Example output, multiline, with footer and human-friendly:
2008-06-24/03:32:20.640/CEST app="my app"
2008-06-24/03:32:20.640/CEST userHome=C:\Users\LBlaze
2008-06-24/03:32:20.640/CEST UPTIME=[0:0.187]
2008-06-24/03:32:20.640/CEST RUNTIME=[Java(TM) SE Runtime Environment
1.6.0_10-beta-b25] VM=[Java HotSpot(TM) Client VM 11.0-b12]
SYSTEM=[Windows XP 5.1 x86]
2008-06-24/03:32:20.640/CEST
MEMORY=[0.95MiB(19.24%/1.49%)/4.94MiB(7.77%)/63.56MiB]
2008-06-24/03:32:20.640/CEST INFO [main]
net.lilianne_blaze.logging.log4j.HeaderPatternLayoutTest
(HeaderPatternLayoutTest.java:53) - Testing readable log4j output.
2008-06-24/03:32:20.640/CEST app="my app"
2008-06-24/03:32:20.640/CEST userHome=C:\Users\LBlaze
2008-06-24/03:32:20.640/CEST UPTIME=[0:0.187]
2008-06-24/03:32:20.640/CEST RUNTIME=[Java(TM) SE Runtime Environment
1.6.0_10-beta-b25] VM=[Java HotSpot(TM) Client VM 11.0-b12]
SYSTEM=[Windows XP 5.1 x86]
2008-06-24/03:32:20.640/CEST
MEMORY=[1.02MiB(20.64%/1.6%)/4.94MiB(7.77%)/63.56MiB]
app and userHome are fully customizable, in fact there are simply
"FirstLine" and "SecondLine" properties to fill up with whatever the
user wants.
memory is current / total / max, as returned by Runtime (total - free) /
total / max.
Second version actually uses 2 patterns, one for logging, one for
header/footer, easier to read by humans. First version uses a single
pattern, providing fake logger/thread/file information to avoid
confusing software parsers, so its output from software point of view is
identical to plain PatternLayout.
Currently I'm trying to come up with a way to identify JEE container
without access to a ServletContext instance, then I'll look into making
a Logback version.
When I finish I'm going to open source it with Apache Licence.
Right now I really could use a couple of beta testers and some
constructive feedback.
Greetings, Lilianne
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]