On Mon, 3 Nov 2003, Wolf Siberski wrote: | You would write: | | public class Sample { | private static Logger tracer = Logger.getLogger("my.log.hierarchy", | "my.levels.trace"); | private static Logger errlog = ...; | ... | if (tracer.isEnabled()) tracer.log("User [id:"+user.getId()+"] added | to update queue."); | }
Then I'd have to make 6 loggers, right? fatalLog, errorLog .. traceLog. I could do that now too. E.g. simply add ".TRACE" behind the category-name. Or in front - or something else. I do get the point with domains (why it'd be cool), it does seem nice (and I've often had the desire to log a statement to two different places in the hierarchy), but I think levels are quite different. | If you like the current logging style more, just write a small | wrapper class: I could do that now too, right? I'd prefer not to. I'd prefer to use the existing functionality of the system. And I don't feel that updating my entire code base is acceptable. | I didn't do any performance measurements, but I'm pretty sure | that the additional call of a final method is negligible | (probably zero if the compiler does decent optimization). Since this is dynamic, either the entire forest of Loggers will have to be updated on a log-reconfigure (which would imply synching on every access, or maybe a volatile could do?), or the Logger itself will have to check multiple places (a List of domains it's attached to?). It alreay have to check multiple places, but it "quick-returns" if it is directly turned off, apparently. | > b) Levels define an implicit view of the -importance- of a | > log-statement - | > and not "where it comes from", or who should view it, as such. It's a | > descriptive -importance level-. Domains wont supersede this. | | This depends on how abstract domains are designed. From a conceptual | viewpoint, you have several dimensions of categories (logger names, | levels, etc.) which don't need to be implemented by different means. | Based on this abstraction everyone can choose (or create) his | personal logging dimensions, of which 'where it comes from' and | 'importance level' are just two examples. Oh, well, the flexibility! Like .NET: code in every single programming language on the earth. It really makes the maintenance of the code a breeze, doesn't it? I'd like to have a linear list of importance levels to which I could decide to log "with" (using one single Logger instance!!), I just feel strongly that one level is missing. View the levels as simply a "tag" (among a highly fixed set of such tags) that denotes the level of importance that a log statement should have. It does not represent "a domain" as such, it's a piece of metadata about the statement stating the importance. Maybe I'm simply on mushrooms or something, could be yesterdays pizza. But I don't think domains will make the levels outdated and obsolete - however, I can see that domains will be a cool way to "route" the log statements. | | > c) Trace is something else! | In the view described above it's just one more category in one dimension. Oh, well. Endre. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]