James Taylor <[EMAIL PROTECTED]> writes: >Oh my god man, could this be more fugly?
I understand that your "I point the component at the logger that _I_ want" approach is for your scenario much simpler. I really do. I also do understand the implications of the IoC concept. I was giving you just some whipped-up example code to illustrate that c-l does not hardcode the loggers on the class name. It was not a pattern you should follow. I just wanted to give you the basic idea. Of course you can also pass down a preloaded o.a.c.l.Log object. Where is the problem? You did seem to be keen on misunderstanding me. So do. Fine. In 90+% of all applications ever written for Turbine, the normal logging scenario will be "one log file containing runtime messages and errors". Maybe two (application and turbine). Dynamic reconfiguration and user-based logging over arbitrary classes IMHO don't come into play here. If you want to go Enterprise solutions, I'd think that Jasons' Plexus/Summit will be soooo much better than our boring bread-and-butter servlet based Turbine-2 stuff. But we will try to release on a regular base and support our user base. Regards Henning >> Huh? >> >> consider a user specific property called "wantDbLogging". >> >> Boolean wantDbLogging = (Boolean) data.getUser().getTemp("wantDbLogging"); >> Log log = LogFactory.getLogger(wantDbLogging.booleanValue() ? "dbLog" : >"normalLog"); >> [...] >> log.debug("foo"); >> >> I can even flip that boolean switch at runtime. >So now all my components requiring logging have to be written to look at >that flag? Also, I have added coupling tun Rundata, User, and thus all >of turbine. Wahoo! >> (actual method names might vary slightly but you get the point). >> >> Commons Logging is _NOT_ "write everything onto the class name based >> logger". This is just the most convenient approach. >Compare this to writing my class as a black box LogEnabled. If I want >the bugger to log to X, Y, Z, or whatever combination, I just hand it >the appropriate Logger, which might wrap commons-logging, log4j, >System.out, the bit bucket, or my evil twin's email account. >The component doesn't CARE whether I want DB logging -- why should it! >-- jt >-- >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen -- Geschaeftsfuehrer INTERMETA - Gesellschaft fuer Mehrwertdienste mbH [EMAIL PROTECTED] Am Schwabachgrund 22 Fon.: 09131 / 50654-0 [EMAIL PROTECTED] D-91054 Buckenhof Fax.: 09131 / 50654-20 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>