On Tue, Aug 11, 2015 at 11:11 AM, Xen <[email protected]> wrote: > Hi, I just wanted to give a little back of what I've been doing. > > I can say programmatic configuration the way it is is *really* hard. > > Mostly it is hard because of > > - having to import a million different things from different packages, and > you can never guess or remember which package it is going to be > - the creator methods take a million parameters >
Some appenders use the builder patten, for example org.apache.logging.log4j.core.appender.ConsoleAppender.Builder. I'm not sure why this appender has both a builder and a create method. Does anyone? Gary > - appenders need to be added twice > - if you create an appender with the same name it will not add it but give > no error > - various static methods from different classes do important things, but > it is not centralized. > - maybe there is too much static in any case, but yeah. > > JAnsi works. I'm doing stuff JAnsi does, and there is already an entire > package that does everything I would want or need to do :P. Go figure. Now > it is even included with my application just to make it work on Windows, > and I don't really want to use it with my default application ;-). (Maybe > I'll have to, given that). Ooh but it doesn't do input > processing/filtering, I might even use it. (My library parses ANSI tokens). > > Anyway to cut it short now, here is a screenshot of what I've been doing: > > http://www.xen.dds.nl/f/i/screenshots/thunderbolt-log4j-reward.png > > The first field is the thread in blue, there are three threads (thread > types): main, server and client. Every client thread gets numbered from a > pool that gets refilled when a thread exits (just a Set I take numbers out > of and I always take the first one (SortedSet/TreeSet)). After that is the > logger name. I don't name my loggers anymore by class but by subsystem. > Essentially, by package, I guess. There are only two packages / subsystems > at the moment that are being shown a third is called "telnet.file" and I > haven't tested it yet. > > It's just that my FileAppender doesn't yet work. However since it > "additives" from "telnet" it also outputs to the console: > > http://www.xen.dds.nl/f/i/screenshots/thunderbolt-log4j-reward2.smaller.png > > Fixed. > > So I have 3 loggerconfigs now: > - "server" --> outputs to root logger > - "telnet" --> outputs to root logger > - "telnet.file" --> additionally outputs to a log file. > > Regards, and enjoy :p. > > Bart. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- E-Mail: [email protected] | [email protected] Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
